Files
lucent-laravel/front/dist/assets/main-BtcBvcC_.js
T

199 lines
2.4 MiB
JavaScript
Raw Normal View History

2024-08-22 17:59:06 +03:00
var nX=Object.defineProperty;var oX=(o,e,n)=>e in o?nX(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var cU=(o,e,n)=>(oX(o,typeof e!="symbol"?e+"":e,n),n);function bind$1(o,e){return function(){return o.apply(e,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf}=Object,kindOf=(o=>e=>{const n=toString$1.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=o=>(o=o.toLowerCase(),e=>kindOf(e)===o),typeOfTest=o=>e=>typeof e===o,{isArray:isArray$2}=Array,isUndefined=typeOfTest("undefined");function isBuffer(o){return o!==null&&!isUndefined(o)&&o.constructor!==null&&!isUndefined(o.constructor)&&isFunction$1(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&isArrayBuffer(o.buffer),e}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=o=>o!==null&&typeof o=="object",isBoolean$1=o=>o===!0||o===!1,isPlainObject=o=>{if(kindOf(o)!=="object")return!1;const e=getPrototypeOf(o);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=o=>isObject$1(o)&&isFunction$1(o.pipe),isFormData=o=>{let e;return o&&(typeof FormData=="function"&&o instanceof FormData||isFunction$1(o.append)&&((e=kindOf(o))==="formdata"||e==="object"&&isFunction$1(o.toString)&&o.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(o,e,{allOwnKeys:n=!1}={}){if(o===null||typeof o>"u")return;let r,c;if(typeof o!="object"&&(o=[o]),isArray$2(o))for(r=0,c=o.length;r<c;r++)e.call(null,o[r],r,o);else{const u=n?Object.getOwnPropertyNames(o):Object.keys(o),h=u.length;let p;for(r=0;r<h;r++)p=u[r],e.call(null,o[p],p,o)}}function findKey$1(o,e){e=e.toLowerCase();const n=Object.keys(o);let r=n.length,c;for(;r-- >0;)if(c=n[r],e===c.toLowerCase())return c;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=o=>!isUndefined(o)&&o!==_global;function merge(){const{caseless:o}=isContextDefined(this)&&this||{},e={},n=(r,c)=>{const u=o&&findKey$1(e,c)||c;isPlainObject(e[u])&&isPlainObject(r)?e[u]=merge(e[u],r):isPlainObject(r)?e[u]=merge({},r):isArray$2(r)?e[u]=r.slice():e[u]=r};for(let r=0,c=arguments.length;r<c;r++)arguments[r]&&forEach(arguments[r],n);return e}const extend$2=(o,e,n,{allOwnKeys:r}={})=>(forEach(e,(c,u)=>{n&&isFunction$1(c)?o[u]=bind$1(c,n):o[u]=c},{allOwnKeys:r}),o),stripBOM=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),inherits=(o,e,n,r)=>{o.prototype=Object.create(e.prototype,r),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:e.prototype}),n&&Object.assign(o.prototype,n)},toFlatObject=(o,e,n,r)=>{let c,u,h;const p={};if(e=e||{},o==null)return e;do{for(c=Object.getOwnPropertyNames(o),u=c.length;u-- >0;)h=c[u],(!r||r(h,o,e))&&!p[h]&&(e[h]=o[h],p[h]=!0);o=n!==!1&&getPrototypeOf(o)}while(o&&(!n||n(o,e))&&o!==Object.prototype);return e},endsWith=(o,e,n)=>{o=String(o),(n===void 0||n>o.length)&&(n=o.length),n-=e.length;const r=o.indexOf(e,n);return r!==-1&&r===n},toArray=o=>{if(!o)return null;if(isArray$2(o))return o;let e=o.length;if(!isNumber$1(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=o[e];return n},isTypedArray=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(o,e)=>{const r=(o&&o[Symbol.iterator]).call(o);let c;for(;(c=r.next())&&!c.done;){const u=c.value;e.call(o,u[0],u[1])}},matchAll=(o,e)=>{let n;const r=[];for(;(n=o.exec(e))!==null;)r.push(n);return r},isHTMLForm=kindOfTest("HTMLFormElement")
`).forEach(function(h){c=h.indexOf(":"),n=h.substring(0,c).trim().toLowerCase(),r=h.substring(c+1).trim(),!(!n||e[n]&&ignoreDuplicateOf[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},$internals=Symbol("internals");function normalizeHeader(o){return o&&String(o).trim().toLowerCase()}function normalizeValue(o){return o===!1||o==null?o:utils$1.isArray(o)?o.map(normalizeValue):String(o)}function parseTokens(o){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(o);)e[r[1]]=r[2];return e}const isValidHeaderName=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function matchHeaderValue(o,e,n,r,c){if(utils$1.isFunction(r))return r.call(this,e,n);if(c&&(e=n),!!utils$1.isString(e)){if(utils$1.isString(r))return e.indexOf(r)!==-1;if(utils$1.isRegExp(r))return r.test(e)}}function formatHeader(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function buildAccessors(o,e){const n=utils$1.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(o,r+n,{value:function(c,u,h){return this[r].call(this,e,c,u,h)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,n,r){const c=this;function u(p,b,y){const k=normalizeHeader(b);if(!k)throw new Error("header name must be a non-empty string");const A=utils$1.findKey(c,k);(!A||c[A]===void 0||y===!0||y===void 0&&c[A]!==!1)&&(c[A||b]=normalizeValue(p))}const h=(p,b)=>utils$1.forEach(p,(y,k)=>u(y,k,b));if(utils$1.isPlainObject(e)||e instanceof this.constructor)h(e,n);else if(utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e))h(parseHeaders(e),n);else if(utils$1.isHeaders(e))for(const[p,b]of e.entries())u(b,p,r);else e!=null&&u(n,e,r);return this}get(e,n){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);if(r){const c=this[r];if(!n)return c;if(n===!0)return parseTokens(c);if(utils$1.isFunction(n))return n.call(this,c,r);if(utils$1.isRegExp(n))return n.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=normalizeHeader(e),e){const r=utils$1.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||matchHeaderValue(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let c=!1;function u(h){if(h=normalizeHeader(h),h){const p=utils$1.findKey(r,h);p&&(!n||matchHeaderValue(r,r[p],p,n))&&(delete r[p],c=!0)}}return utils$1.isArray(e)?e.forEach(u):u(e),c}clear(e){const n=Object.keys(this);let r=n.length,c=!1;for(;r--;){const u=n[r];(!e||matchHeaderValue(this,this[u],u,e,!0))&&(delete this[u],c=!0)}return c}normalize(e){const n=this,r={};return utils$1.forEach(this,(c,u)=>{const h=utils$1.findKey(r,u);if(h){n[h]=normalizeValue(c),delete n[u];return}const p=e?formatHeader(u):String(u).trim();p!==u&&delete n[u],n[p]=normalizeValue(c),r[p]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return utils$1.forEach(this,(r,c)=>{r!=null&&r!==!1&&(n[c]=e&&utils$1.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
2024-08-23 18:15:18 +03:00
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(c=>r.set(c)),r}static accessor(e){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,c=this.prototype;function u(h){const p=normalizeHeader(h);r[p]||(buildAccessors(c,h),r[p]=!0)}return utils$1.isArray(e)?e.forEach(u):u(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:o},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>o,set(r){this[n]=r}}});utils$1.freezeMethods(AxiosHeaders);function transformData(o,e){const n=this||defaults$4,r=e||n,c=AxiosHeaders.from(r.headers);let u=r.data;return utils$1.forEach(o,function(p){u=p.call(n,u,c.normalize(),e?e.status:void 0)}),c.normalize(),u}function isCancel(o){return!!(o&&o.__CANCEL__)}function CanceledError(o,e,n){AxiosError.call(this,o??"canceled",AxiosError.ERR_CANCELED,e,n),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(o,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?o(n):e(new AxiosError("Request failed with status code "+n.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(o){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return e&&e[1]||""}function speedometer(o,e){o=o||10;const n=new Array(o),r=new Array(o);let c=0,u=0,h;return e=e!==void 0?e:1e3,function(b){const y=Date.now(),k=r[u];h||(h=y),n[c]=b,r[c]=y;let A=u,R=0;for(;A!==c;)R+=n[A++],A=A%o;if(c=(c+1)%o,c===u&&(u=(u+1)%o),y-h<e)return;const N=k&&y-k;return N?Math.round(R*1e3/N):void 0}}function throttle$1(o,e){let n=0,r=1e3/e,c,u;const h=(y,k=Date.now())=>{n=k,c=null,u&&(clearTimeout(u),u=null),o.apply(null,y)};return[(...y)=>{const k=Date.now(),A=k-n;A>=r?h(y,k):(c=y,u||(u=setTimeout(()=>{u=null,h(c)},r-A)))},()=>c&&h(c)]}const progressEventReducer=(o,e,n=3)=>{let r=0;const c=speedometer(50,250);return throttle$1(u=>{const h=u.loaded,p=u.lengthComputable?u.total:void 0,b=h-r,y=c(b),k=h<=p;r=h;const A={loaded:h,total:p,progress:p?h/p:void 0,bytes:b,rate:y||void 0,estimated:y&&p&&k?(p-h)/y:void 0,event:u,lengthComputable:p!=null,[e?"download":"upload"]:!0};o(A)},n)},progressEventDecorator=(o,e)=>{const n=o!=null;return[r=>e[0]({lengthComputable:n,total:o,loaded:r}),e[1]]},asyncDecorator=o=>(...e)=>utils$1.asap(()=>o(...e)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function c(u){let h=u;return e&&(n.setAttribute("href",h),h=n.href),n.setAttribute("href",h),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=c(window.location.href),function(h){const p=utils$1.isString(h)?c(h):h;return p.protocol===r.protocol&&p.host===r.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(o,e,n,r,c,u){const h=[o+"="+encodeURIComponent(e)];utils$1.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),utils$1.isString(r)&&h.push("path="+r),utils$1.isString(c)&&h.push("domain="+c),u===!0&&h.push("secure"),document.cookie=h.join("; ")},read(o){const e=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function combineURLs(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}function buildFullPath(o,e){return o&&!isAbsoluteURL(e)?combineURLs(o,e):e}const headersToObject=o=>o instanceof AxiosHeaders?{...o}:o;function mergeConfig(o,e){e=e||{};const n={};function r(y,k,A){return utils$1.isPlainObject(y)&&ut
2024-08-22 17:59:06 +03:00
`+u.map(renderReason).join(`
`):" "+renderReason(u[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return r},adapters:knownAdapters};function throwIfCancellationRequested(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new CanceledError(null,o)}function dispatchRequest(o){return throwIfCancellationRequested(o),o.headers=AxiosHeaders.from(o.headers),o.data=transformData.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(o.adapter||defaults$4.adapter)(o).then(function(r){return throwIfCancellationRequested(o),r.data=transformData.call(o,o.transformResponse,r),r.headers=AxiosHeaders.from(r.headers),r},function(r){return isCancel(r)||(throwIfCancellationRequested(o),r&&r.response&&(r.response.data=transformData.call(o,o.transformResponse,r.response),r.response.headers=AxiosHeaders.from(r.response.headers))),Promise.reject(r)})}const VERSION="1.7.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{validators$1[o]=function(r){return typeof r===o||"a"+(e<1?"n ":" ")+o}});const deprecatedWarnings={};validators$1.transitional=function(e,n,r){function c(u,h){return"[Axios v"+VERSION+"] Transitional option '"+u+"'"+h+(r?". "+r:"")}return(u,h,p)=>{if(e===!1)throw new AxiosError(c(h," has been removed"+(n?" in "+n:"")),AxiosError.ERR_DEPRECATED);return n&&!deprecatedWarnings[h]&&(deprecatedWarnings[h]=!0,console.warn(c(h," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(u,h,p):!0}};function assertOptions(o,e,n){if(typeof o!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const r=Object.keys(o);let c=r.length;for(;c-- >0;){const u=r[c],h=e[u];if(h){const p=o[u],b=p===void 0||h(p,u,o);if(b!==!0)throw new AxiosError("option "+u+" must be "+b,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError("Unknown option "+u,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let c;Error.captureStackTrace?Error.captureStackTrace(c={}):c=new Error;const u=c.stack?c.stack.replace(/^.+\n/,""):"";try{r.stack?u&&!String(r.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+u):r.stack=u}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=mergeConfig(this.defaults,n);const{transitional:r,paramsSerializer:c,headers:u}=n;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),c!=null&&(utils$1.isFunction(c)?n.paramsSerializer={serialize:c}:validator.assertOptions(c,{encode:validators.function,serialize:validators.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let h=u&&utils$1.merge(u.common,u[n.method]);u&&utils$1.forEach(["delete","get","head","post","put","patch","common"],F=>{delete u[F]}),n.headers=AxiosHeaders.concat(h,u);const p=[];let b=!0;this.interceptors.request.forEach(function(V){typeof V.runWhen=="function"&&V.runWhen(n)===!1||(b=b&&V.synchronous,p.unshift(V.fulfilled,V.rejected))});const y=[];this.interceptors.response.forEach(function(V){y.push(V.fulfilled,V.rejected)});let k,A=0,R;if(!b){const F=[dispatchRequest.bind(this),void 0];for(F.unshift.apply(F,p),F.push.apply(F,y),R=F.length,k=Promise.resolve(n);A<R;)k=k.then(F[A++],F[A++]);return k}R=p.length;let N=n;for(A=0;A<R;){const F=p[A++],V=p[A++];try{N=F(N)}catch(W){V.call(this,W);break}}try{k=dispatchRequest.call(this,N)}catch(F){return Promise.reject(F)}for(A=0,R=y.length;A<R;)k=k.then(y[A++],y[A++]);return k}getUri(e){e=mergeConfig(this.defaults,e);const n=buildFullPath(e.baseURL,e.url);return buildURL(n,e.params,e.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(n,r){return this.request(mergeConfig(r||{},{method:e,url:n,data:(r||{}).data}))}});utils$1.forEach(["post","put","patch"],function(e){function n(r){return function(u,h,p){return this.request(mergeConfig(p||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:u,data:h}))}}Axios.prototype[e]=n(),Axios.prototype[e+"Form"]=n(!0)});class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(u){n=u});const r=this;this.promise.then(c=>{if(!r._listeners)return;let u=r._listeners.length;for(;u-- >0;)r._listeners[u](c);r._listeners=null}),this.promise.then=c=>{let u;const h=new Promise(p=>{r.subscribe(p),u=p}).then(c);return h.cancel=function(){r.unsubscribe(u)},h},e(function(u,h,p){r.reason||(r.reason=new CanceledError(u,h,p),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new CancelToken(function(c){e=c}),cancel:e}}}function spread(o){return function(n){return o.apply(null,n)}}function isAxiosError(o){return utils$1.isObject(o)&&o.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersi
`;for(let W=0;W<=1;W+=b){const J=e+(n-e)*u(W);y+=W*100+`%{${h(J,1-J)}}
`}const k=y+`100% {${h(n,1-n)}}
2024-08-23 18:15:18 +03:00
}`,A=`__svelte_${hash$1(k)}_${p}`,R=get_root_for_style(o),{stylesheet:N,rules:F}=managed_styles.get(R)||create_style_information(R,o);F[A]||(F[A]=!0,N.insertRule(`@keyframes ${A} ${k}`,N.cssRules.length));const V=o.style.animation||"";return o.style.animation=`${V?`${V}, `:""}${A} ${r}ms linear ${c}ms 1 both`,active+=1,A}function delete_rule(o,e){const n=(o.style.animation||"").split(", "),r=n.filter(e?u=>u.indexOf(e)<0:u=>u.indexOf("__svelte")===-1),c=n.length-r.length;c&&(o.style.animation=r.join(", "),active-=c,active||clear_rules())}function clear_rules(){raf(()=>{active||(managed_styles.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&detach(e)}),managed_styles.clear())})}let current_component;function set_current_component(o){current_component=o}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(o){get_current_component().$$.on_mount.push(o)}function afterUpdate(o){get_current_component().$$.after_update.push(o)}function onDestroy(o){get_current_component().$$.on_destroy.push(o)}function createEventDispatcher(){const o=get_current_component();return(e,n,{cancelable:r=!1}={})=>{const c=o.$$.callbacks[e];if(c){const u=custom_event(e,n,{cancelable:r});return c.slice().forEach(h=>{h.call(o,u)}),!u.defaultPrevented}return!0}}function setContext(o,e){return get_current_component().$$.context.set(o,e),e}function getContext$1(o){return get_current_component().$$.context.get(o)}function bubble(o,e){const n=o.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(o){render_callbacks.push(o)}function add_flush_callback(o){flush_callbacks.push(o)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const o=current_component;do{try{for(;flushidx<dirty_components.length;){const e=dirty_components[flushidx];flushidx++,set_current_component(e),update(e.$$)}}catch(e){throw dirty_components.length=0,flushidx=0,e}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let e=0;e<render_callbacks.length;e+=1){const n=render_callbacks[e];seen_callbacks.has(n)||(seen_callbacks.add(n),n())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(o)}function update(o){if(o.fragment!==null){o.update(),run_all(o.before_update);const e=o.dirty;o.dirty=[-1],o.fragment&&o.fragment.p(o.ctx,e),o.after_update.forEach(add_render_callback)}}function flush_render_callbacks(o){const e=[],n=[];render_callbacks.forEach(r=>o.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),render_callbacks=e}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch(o,e,n){o.dispatchEvent(custom_event(`${e?"intro":"outro"}${n}`))}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(o,e){o&&o.i&&(outroing.delete(o),o.i(e))}function transition_out(o,e,n,r){if(o&&o.o){if(outroing.has(o))return;outroing.add(o),outros.c.push(()=>{outroing.delete(o),r&&(n&&o.d(1),r())}),o.o(e)}else r&&r()}const null_transition={duration:0};function create_bidirectional_transition(o,e,n,r){let u=e(o,n,{direction:"both"}),h=r?0:1,p=null,b=null,y=null,k;function A(){y&&delete_rule(o,y)}function R(F,V){const W=F.b-h;return V*=Math.abs(W),{a:h,b:F.b,d:W,duration:V,start:F.start,end:F.start+V,group:F.group}}function N(F){const{delay:V=0,duration:W=300,easing:J=identity,tick:te=noop,css:j}=u||null_transition,ae={start:now()+V,b:F};F||(ae.group=outros,outros.r+=1),"inert"in o&&(F?k!==void 0&&(o.iner
2024-08-22 17:59:06 +03:00
transform: ${y} translate(${(1-V)*A}${R}, ${(1-V)*N}${F});
2024-08-23 18:15:18 +03:00
opacity: ${b-k*W}`}}function create_if_block$U(o){let e,n,r,c,u,h,p;return{c(){e=element("div"),n=element("div"),n.textContent="Success",r=space$3(),c=element("div"),u=text(o[1]),attr(n,"class","title"),attr(c,"class","content"),attr(e,"class","notice notice-success"),attr(e,"role","alert")},m(b,y){insert$1(b,e,y),append(e,n),append(e,r),append(e,c),append(c,u),p=!0},p(b,y){(!p||y&2)&&set_data(u,b[1])},i(b){p||(b&&add_render_callback(()=>{p&&(h||(h=create_bidirectional_transition(e,fly,{duration:500},!0)),h.run(1))}),p=!0)},o(b){b&&(h||(h=create_bidirectional_transition(e,fly,{duration:500},!1)),h.run(0)),p=!1},d(b){b&&detach(e),b&&h&&h.end()}}}function create_fragment$1n(o){let e,n=o[0]&&create_if_block$U(o);return{c(){n&&n.c(),e=empty$1()},m(r,c){n&&n.m(r,c),insert$1(r,e,c)},p(r,[c]){r[0]?n?(n.p(r,c),c&1&&transition_in(n,1)):(n=create_if_block$U(r),n.c(),transition_in(n,1),n.m(e.parentNode,e)):n&&(group_outros(),transition_out(n,1,1,()=>{n=null}),check_outros())},i(r){transition_in(n)},o(r){transition_out(n)},d(r){r&&detach(e),n&&n.d(r)}}}function instance$1n(o,e,n){let r,c;function u(h="Saved"){n(1,r=h),n(0,c=!0),setTimeout(function(){n(0,c=!1)},2e3)}return n(1,r="Saved"),n(0,c=!1),[c,r,u]}class SuccessAlert extends SvelteComponent{constructor(e){super(),init(this,e,instance$1n,create_fragment$1n,safe_not_equal,{show:2})}get show(){return this.$$.ctx[2]}}function create_fragment$1m(o){let e,n,r,c,u,h,p,b,y,k,A,R,N,F,V={};return e=new SuccessAlert({props:V}),o[4](e),A=new SpinnerButton({props:{label:"Enter"}}),{c(){create_component(e.$$.fragment),n=space$3(),r=element("div"),c=element("form"),u=element("div"),h=element("h3"),p=text("Login as "),b=text(o[0]),y=space$3(),k=element("div"),create_component(A.$$.fragment),attr(u,"class","mb-3 text-center"),attr(k,"class","text-center mt-5 d-block"),attr(r,"class","wrapper-tiny")},m(W,J){mount_component(e,W,J),insert$1(W,n,J),insert$1(W,r,J),append(r,c),append(c,u),append(u,h),append(h,p),append(h,b),append(c,y),append(c,k),mount_component(A,k,null),R=!0,N||(F=listen(c,"submit",o[2]),N=!0)},p(W,[J]){const te={};e.$set(te),(!R||J&1)&&set_data(b,W[0])},i(W){R||(transition_in(e.$$.fragment,W),transition_in(A.$$.fragment,W),R=!0)},o(W){transition_out(e.$$.fragment,W),transition_out(A.$$.fragment,W),R=!1},d(W){W&&(detach(n),detach(r)),o[4](null),destroy_component(e,W),destroy_component(A),N=!1,F()}}}function instance$1m(o,e,n){const r=getContext$1("channel");let{email:c}=e,{token:u}=e,h;function p(y){y.preventDefault(),axios.post(r.lucentUrl+"/verify",{email:c,token:u}).then(k=>{window.location=r.lucentUrl}).catch(k=>{})}function b(y){binding_callbacks[y?"unshift":"push"](()=>{h=y,n(1,h)})}return o.$$set=y=>{"email"in y&&n(0,c=y.email),"token"in y&&n(3,u=y.token)},[c,h,p,u,b]}class Verify extends SvelteComponent{constructor(e){super(),init(this,e,instance$1m,create_fragment$1m,safe_not_equal,{email:0,token:3})}}function create_fragment$1l(o){let e,n,r;return{c(){e=element("div"),n=element("div"),r=text(o[2]),attr(n,"class","avatar__letters"),attr(e,"class","avatar"),attr(e,"title",o[0]),set_style(e,"background-color",o[3][o[4]]),set_style(e,"height",o[1]+"px"),set_style(e,"width",o[1]+"px"),set_style(e,"font-size",o[1]/2+"px")},m(c,u){insert$1(c,e,u),append(e,n),append(n,r)},p(c,[u]){u&4&&set_data(r,c[2]),u&1&&attr(e,"title",c[0]),u&2&&set_style(e,"height",c[1]+"px"),u&2&&set_style(e,"width",c[1]+"px"),u&2&&set_style(e,"font-size",c[1]/2+"px")},i:noop,o:noop,d(c){c&&detach(e)}}}function instance$1l(o,e,n){let{name:r}=e,{side:c=48}=e;const u=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let h="";r.split(" ").length>1?h=r.split(" ")[0].charAt(0).toUpperCase()+r.split(" ")[1].charAt(0).toUpperCase():h=r.split(" ")[0].charAt(0).toUpperCase()+r.split(" ")[0].charAt(1).toUpperCase();let b=(r.charCodeAt(1)+r.length)%19;return o.$$set=y=>{"name"in y&&n(0,r=y.name),"side"in y&&n(1,c=y.side)},[r,c,h,u,b]}class Avatar extends SvelteComponent{constructor(e){super(
device`),attr(h,"class","header-small mb-5"),attr(A,"type","text"),attr(A,"class","form-control mb-3"),attr(A,"placeholder","Name"),A.required=!0,attr(k,"class","input-group mb-5"),attr(J,"type","email"),attr(J,"class","form-control mb-3"),attr(J,"placeholder","Email"),J.required=!0,attr(W,"class","input-group mb-5"),attr(_e,"class","list-group-item list-group-item-action"),attr(_e,"href",o[5].lucentUrl+"/logout"),attr(fe,"class","list-group"),attr(e,"class","wrapper-tiny")},m(Oe,yt){insert$1(Oe,e,yt),mount_component(n,e,null),append(e,r),mount_component(c,e,null),append(e,u),append(e,h),mount_component(p,h,null),append(e,b),append(e,y),append(y,k),append(k,A),set_input_value(A,o[0]),append(k,R),mount_component(N,k,null),append(e,F),append(e,V),append(V,W),append(W,J),set_input_value(J,o[1]),append(W,te),mount_component(j,W,null),append(e,ae),append(e,fe),append(fe,_e),append(_e,ne),Se=!0,De||(Be=[listen(A,"input",o[9]),listen(y,"submit",o[6]),listen(J,"input",o[10]),listen(V,"submit",o[7])],De=!0)},p(Oe,[yt]){const Tt={};yt&4&&(Tt.message=Oe[2]),n.$set(Tt);const St={};c.$set(St),yt&1&&A.value!==Oe[0]&&set_input_value(A,Oe[0]),yt&2&&J.value!==Oe[1]&&set_input_value(J,Oe[1])},i(Oe){Se||(transition_in(n.$$.fragment,Oe),transition_in(c.$$.fragment,Oe),transition_in(p.$$.fragment,Oe),transition_in(N.$$.fragment,Oe),transition_in(j.$$.fragment,Oe),Se=!0)},o(Oe){transition_out(n.$$.fragment,Oe),transition_out(c.$$.fragment,Oe),transition_out(p.$$.fragment,Oe),transition_out(N.$$.fragment,Oe),transition_out(j.$$.fragment,Oe),Se=!1},d(Oe){Oe&&detach(e),destroy_component(n),o[8](null),destroy_component(c),destroy_component(p),destroy_component(N),destroy_component(j),De=!1,run_all(Be)}}}function instance$1k(o,e,n){const r=getContext$1("user"),c=getContext$1("channel");let u=r.name,h=r.email,p="",b;function y(F){F.preventDefault(),n(2,p=""),axios.post(c.lucentUrl+"/account/update-name",{name:u}).then(V=>{b.show()}).catch(V=>{var W;n(2,p=(W=V.response)==null?void 0:W.data.error),console.log({errorMessage:p})})}function k(F){F.preventDefault(),n(2,p=""),axios.post(c.lucentUrl+"/account/update-email",{email:h}).then(V=>{b.show()}).catch(V=>{var W;n(2,p=(W=V.response)==null?void 0:W.data.error),console.log({errorMessage:p})})}function A(F){binding_callbacks[F?"unshift":"push"](()=>{b=F,n(3,b)})}function R(){u=this.value,n(0,u)}function N(){h=this.value,n(1,h)}return[u,h,p,b,r,c,y,k,A,R,N]}class Profile extends SvelteComponent{constructor(e){super(),init(this,e,instance$1k,create_fragment$1k,safe_not_equal,{})}}function create_fragment$1j(o){let e,n,r,c=o[3].name+"",u,h,p,b,y,k;const A=[{title:o[0]},o[2]];var R=o[4][o[1]];function N(F,V){let W={};for(let J=0;J<A.length;J+=1)W=assign(W,A[J]);return V!==void 0&&V&5&&(W=assign(W,get_spread_update(A,[V&1&&{title:F[0]},V&4&&get_spread_object(F[2])]))),{props:W}}return R&&(y=construct_svelte_component(R,N(o))),{c(){e=element("div"),n=element("h1"),r=element("a"),u=text(c),p=space$3(),b=element("div"),y&&create_component(y.$$.fragment),attr(r,"class","text-decoration-none"),attr(r,"href",h=o[3].lucentUrl),set_style(e,"text-align","center"),set_style(e,"background","var(--p20)"),set_style(e,"padding","20px"),set_style(e,"color","var(--p90)")},m(F,V){insert$1(F,e,V),append(e,n),append(n,r),append(r,u),insert$1(F,p,V),insert$1(F,b,V),y&&mount_component(y,b,null),k=!0},p(F,[V]){if((!k||V&8)&&c!==(c=F[3].name+"")&&set_data(u,c),(!k||V&8&&h!==(h=F[3].lucentUrl))&&attr(r,"href",h),V&2&&R!==(R=F[4][F[1]])){if(y){group_outros();const W=y;transition_out(W.$$.fragment,1,0,()=>{destroy_component(W,1)}),check_outros()}R?(y=construct_svelte_component(R,N(F,V)),create_component(y.$$.fragment),transition_in(y.$$.fragment,1),mount_component(y,b,null)):y=null}else if(R){const W=V&5?get_spread_update(A,[V&1&&{title:F[0]},V&4&&get_spread_object(F[2])]):{};y.$set(W)}},i(F){k||(y&&transition_in(y.$$.fragment,F),k=!0)},o(F){y&&transition_out(y.$$.fragment,F),k=!1},d(F){F&&(detach(e),detach(p),detach(b)),y&&destroy_component(y)}}}function instance$1j(o,e,n){const r={register:Register,login:Login,verify:
2024-08-22 17:59:06 +03:00
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2024-08-23 18:15:18 +03:00
*/lodash.exports;(function(o,e){(function(){var n,r="4.17.21",c=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",p="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",y=500,k="__lodash_placeholder__",A=1,R=2,N=4,F=1,V=2,W=1,J=2,te=4,j=8,ae=16,fe=32,_e=64,ne=128,Se=256,De=512,Be=30,Te="...",Oe=800,yt=16,Tt=1,St=2,q=3,Le=1/0,je=9007199254740991,mn=17976931348623157e292,Rt=NaN,Ue=4294967295,ct=Ue-1,dn=Ue>>>1,Zt=[["ary",ne],["bind",W],["bindKey",J],["curry",j],["curryRight",ae],["flip",De],["partial",fe],["partialRight",_e],["rearg",Se]],rn="[object Arguments]",Fe="[object Array]",mt="[object AsyncFunction]",de="[object Boolean]",Eo="[object Date]",jn="[object DOMException]",Yn="[object Error]",po="[object Function]",cs="[object GeneratorFunction]",gt="[object Map]",Ut="[object Number]",pt="[object Null]",Ne="[object Object]",Nt="[object Promise]",pn="[object Proxy]",xt="[object RegExp]",kn="[object Set]",Dn="[object String]",is="[object Symbol]",Gn="[object Undefined]",as="[object WeakMap]",vr="[object WeakSet]",Ns="[object ArrayBuffer]",Vs="[object DataView]",Ts="[object Float32Array]",Ki="[object Float64Array]",vs="[object Int8Array]",ms="[object Int16Array]",dr="[object Int32Array]",Oo="[object Uint8Array]",wo="[object Uint8ClampedArray]",Gs="[object Uint16Array]",ws="[object Uint32Array]",Pi=/\b__p \+= '';/g,ts=/\b(__p \+=) '' \+/g,Qi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,nn=/&(?:amp|lt|gt|quot|#39);/g,ns=/[&<>"']/g,Xr=RegExp(nn.source),Qe=RegExp(ns.source),Ye=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,Ft=/<%=([\s\S]+?)%>/g,Rn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xn=/^\w*$/,ro=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,an=/[\\^$.*+?()[\]{}|]/g,Do=RegExp(an.source),io=/^\s+/,Wo=/\s/,sr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mr=/\{\n\/\* \[wrapped with (.+)\] \*/,Ks=/,? & /,pr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Di=/[()=,{}\[\]\/\s]/,cc=/\\(\\)?/g,mi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,Xe=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Qt=/^\[object .+?Constructor\]$/,eo=/^0o[0-7]+$/i,co=/^(?:0|[1-9]\d*)$/,qo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fr=/($^)/,nt=/['\n\r\u2028\u2029\\]/g,xo="\\ud800-\\udfff",jr="\\u0300-\\u036f",Oi="\\ufe20-\\ufe2f",ra="\\u20d0-\\u20ff",zs=jr+Oi+ra,Ec="\\u2700-\\u27bf",ul="a-z\\xdf-\\xf6\\xf8-\\xff",ga="\\xac\\xb1\\xd7\\xf7",Ri="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",As="\\u2000-\\u206f",rr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vi="A-Z\\xc0-\\xd6\\xd8-\\xde",ia="\\ufe0e\\ufe0f",Pl=ga+Ri+As+rr,Tc="[']",Ac="["+xo+"]",Ls="["+Pl+"]",Ji="["+zs+"]",ka="\\d+",Gc="["+Ec+"]",xa="["+ul+"]",Yr="[^"+xo+Pl+ka+Ec+ul+Vi+"]",hr="\\ud83c[\\udffb-\\udfff]",ja="(?:"+Ji+"|"+hr+")",bu="[^"+xo+"]",Us="(?:\\ud83c[\\udde6-\\uddff]){2}",Mi="[\\ud800-\\udbff][\\udc00-\\udfff]",zi="["+Vi+"]",yi="\\u200d",yl="(?:"+xa+"|"+Yr+")",ql="(?:"+zi+"|"+Yr+")",ba="(?:"+Tc+"(?:d|ll|m|re|s|t|ve))?",Dl="(?:"+Tc+"(?:D|LL|M|RE|S|T|VE))?",Rl=ja+"?",cd="["+ia+"]?",Ml="(?:"+yi+"(?:"+[bu,Us,Mi].join("|")+")"+cd+Rl+")*",Qu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ya="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uc=cd+Rl+Ml,vu="(?:"+[Gc,Us,Mi].join("|")+")"+uc,ud="(?:"+[bu+Ji+"?",Ji,Us,Mi,Ac].join("|")+")",Kd=RegExp(Tc,"g"),Ee=RegExp(Ji,"g"),Ke=RegExp(hr+"(?="+hr+")|"+ud+uc,"g"),ht=RegExp([zi+"?"+xa+"+"+ba+"(?="+[Ls,zi,"$"].join("|")+")",ql+"+"+Dl+"(?="+[Ls,zi+yl,"$"].join("|")+")",zi+"?"+yl+"+"+ba,zi+"+"+Dl,Ya,Qu,ka,vu].join("|"),"g"),At=RegExp("["+yi+xo+zs+ia+"]"),fn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,go=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parse
2024-08-22 17:59:06 +03:00
/* [wrapped with `+D+`] */
2024-08-23 18:15:18 +03:00
`)}function z0(E){return os(E)||Va(E)||!!(ef&&E&&E[ef])}function Ch(E,D){var Z=typeof E;return D=D??je,!!D&&(Z=="number"||Z!="symbol"&&co.test(E))&&E>-1&&E%1==0&&E<D}function Hc(E,D,Z){if(!ha(Z))return!1;var ce=typeof D;return(ce=="number"?zr(Z)&&Ch(D,Z.length):ce=="string"&&D in Z)?sa(Z[D],E):!1}function kh(E,D){if(os(E))return!1;var Z=typeof E;return Z=="number"||Z=="symbol"||Z=="boolean"||E==null||ji(E)?!0:Xn.test(E)||!Rn.test(E)||D!=null&&E in br(D)}function ig(E){var D=typeof E;return D=="string"||D=="number"||D=="symbol"||D=="boolean"?E!=="__proto__":E===null}function sp(E){var D=sg(E),Z=xe[D];if(typeof Z!="function"||!(D in _r.prototype))return!1;if(E===Z)return!0;var ce=Pd(Z);return!!ce&&E===ce[0]}function ag(E){return!!el&&el in E}var hb=Ci?Lf:bp;function Gu(E){var D=E&&E.constructor,Z=typeof D=="function"&&D.prototype||la;return E===Z}function Dd(E){return E===E&&!ha(E)}function lg(E,D){return function(Z){return Z==null?!1:Z[E]===D&&(D!==n||E in br(Z))}}function Ku(E){var D=ed(E,function(ce){return Z.size===y&&Z.clear(),ce}),Z=D.cache;return D}function mb(E,D){var Z=E[1],ce=D[1],Ce=Z|ce,ze=Ce<(W|J|ne),it=ce==ne&&Z==j||ce==ne&&Z==Se&&E[7].length<=D[8]||ce==(ne|Se)&&D[7].length<=D[8]&&Z==j;if(!(ze||it))return E;ce&W&&(E[2]=D[2],Ce|=Z&W?0:te);var bt=D[3];if(bt){var Lt=E[3];E[3]=Lt?h1(Lt,bt,D[4]):bt,E[4]=Lt?hl(E[3],k):D[4]}return bt=D[5],bt&&(Lt=E[5],E[5]=Lt?vh(Lt,bt,D[6]):bt,E[6]=Lt?hl(E[5],k):D[6]),bt=D[7],bt&&(E[7]=bt),ce&ne&&(E[8]=E[8]==null?D[8]:Ia(E[8],D[8])),E[9]==null&&(E[9]=D[9]),E[0]=D[0],E[1]=Ce,E}function LO(E){var D=[];if(E!=null)for(var Z in br(E))D.push(Z);return D}function cg(E){return xf.call(E)}function Df(E,D,Z){return D=qi(D===n?E.length-1:D,0),function(){for(var ce=arguments,Ce=-1,ze=qi(ce.length-D,0),it=Kt(ze);++Ce<ze;)it[Ce]=ce[D+Ce];Ce=-1;for(var bt=Kt(D+1);++Ce<D;)bt[Ce]=ce[Ce];return bt[D]=Z(it),yr(E,this,bt)}}function FO(E,D){return D.length<2?E:tl(E,ds(D,0,-1))}function ug(E,D){for(var Z=E.length,ce=Ia(D.length,Z),Ce=ec(E);ce--;){var ze=D[ce];E[ce]=Ch(ze,Z)?Ce[ze]:n}return E}function xh(E,D){if(!(D==="constructor"&&typeof E[D]=="function")&&D!="__proto__")return E[D]}var Ju=U0(Lc),Hl=Ea||function(E,D){return me.setTimeout(E,D)},W0=U0(lm);function Z0(E,D,Z){var ce=D+"";return W0(E,ow(ce,pb(eC(ce),Z)))}function U0(E){var D=0,Z=0;return function(){var ce=Zp(),Ce=yt-(ce-Z);if(Z=ce,Ce>0){if(++D>=Oe)return arguments[0]}else D=0;return E.apply(n,arguments)}}function dg(E,D){var Z=-1,ce=E.length,Ce=ce-1;for(D=D===n?ce:D;++Z<D;){var ze=Cd(Z,Ce),it=E[ze];E[ze]=E[Z],E[Z]=it}return E.length=D,E}var Qc=Ku(function(E){var D=[];return E.charCodeAt(0)===46&&D.push(""),E.replace(ro,function(Z,ce,Ce,ze){D.push(Ce?ze.replace(cc,"$1"):ce||Z)}),D});function lu(E){if(typeof E=="string"||ji(E))return E;var D=E+"";return D=="0"&&1/E==-Le?"-0":D}function Rf(E){if(E!=null){try{return nu.call(E)}catch{}try{return E+""}catch{}}return""}function pb(E,D){return Jo(Zt,function(Z){var ce="_."+Z[0];D&Z[1]&&!Nr(E,ce)&&E.push(ce)}),E.sort()}function HO(E){if(E instanceof _r)return E.clone();var D=new jl(E.__wrapped__,E.__chain__);return D.__actions__=ec(E.__actions__),D.__index__=E.__index__,D.__values__=E.__values__,D}function QO(E,D,Z){(Z?Hc(E,D,Z):D===n)?D=1:D=qi(cr(D),0);var ce=E==null?0:E.length;if(!ce||D<1)return[];for(var Ce=0,ze=0,it=Kt(Dc(ce/D));Ce<ce;)it[ze++]=ds(E,Ce,Ce+=D);return it}function q0(E){for(var D=-1,Z=E==null?0:E.length,ce=0,Ce=[];++D<Z;){var ze=E[D];ze&&(Ce[ce++]=ze)}return Ce}function fg(){var E=arguments.length;if(!E)return[];for(var D=Kt(E-1),Z=arguments[0],ce=E;ce--;)D[ce-1]=arguments[ce];return Vu(os(Z)?ec(Z):[Z],Li(D,1))}var hg=Xs(function(E,D){return za(E)?ca(E,Li(D,1,za,!0)):[]}),gb=Xs(function(E,D){var Z=Rd(D);return za(Z)&&(Z=n),za(E)?ca(E,Li(D,1,za,!0),ls(Z,2)):[]}),sw=Xs(function(E,D){var Z=Rd(D);return za(Z)&&(Z=n),za(E)?ca(E,Li(D,1,za,!0),n,Z):[]});function bb(E,D,Z){var ce=E==null?0:E.length;return ce?(D=Z||D===n?1:cr(D),ds(E,D<0?0:D,ce)):[]}function mg(E,D,Z){var ce=E==null?0:E.length;return ce?(D=Z||D===n?1:cr(D),D=ce-D,ds(E,0,D<0?0:D)):[]}function rw(E,D){return E&&E.length?Af(E,
2024-08-22 17:59:06 +03:00
`;E.replace(yo,function(bs,Tr,Wr,El,rc,nd){return Wr||(Wr=El),Bn+=E.slice(wn,nd).replace(nt,_l),Tr&&(bt=!0,Bn+=`' +
__e(`+Tr+`) +
2024-08-23 18:15:18 +03:00
'`),rc&&(Lt=!0,Bn+=`';
2024-08-22 17:59:06 +03:00
`+rc+`;
__p += '`),Wr&&(Bn+=`' +
((__t = (`+Wr+`)) == null ? '' : __t) +
'`),wn=nd+bs.length,bs}),Bn+=`';
`;var Cs=Dr.call(D,"variable")&&D.variable;if(!Cs)Bn=`with (obj) {
`+Bn+`
}
2024-08-23 18:15:18 +03:00
`;else if(Di.test(Cs))throw new ps(p);Bn=(Lt?Bn.replace(Pi,""):Bn).replace(ts,"$1").replace(Qi,"$1;"),Bn="function("+(Cs||"obj")+`) {
2024-08-22 17:59:06 +03:00
`+(Cs?"":`obj || (obj = {});
2024-08-23 18:15:18 +03:00
`)+"var __t, __p = ''"+(bt?", __e = _.escape":"")+(Lt?`, __j = Array.prototype.join;
2024-08-22 17:59:06 +03:00
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Bn+`return __p
2024-08-23 18:15:18 +03:00
}`;var nr=gy(function(){return qs(ze,jo+"return "+Bn).apply(n,it)});if(nr.source=Bn,lv(nr))throw nr;return nr}function Nw(E){return vi(E).toLowerCase()}function Fb(E){return vi(E).toUpperCase()}function Iw(E,D,Z){if(E=vi(E),E&&(Z||D===n))return Ja(E);if(!E||!(D=gi(D)))return E;var ce=ml(E),Ce=ml(D),ze=hc(ce,Ce),it=md(ce,Ce)+1;return Xu(ce,ze,it).join("")}function py(E,D,Z){if(E=vi(E),E&&(Z||D===n))return E.slice(0,Wm(E)+1);if(!E||!(D=gi(D)))return E;var ce=ml(E),Ce=md(ce,ml(D))+1;return Xu(ce,0,Ce).join("")}function Pg(E,D,Z){if(E=vi(E),E&&(Z||D===n))return E.replace(io,"");if(!E||!(D=gi(D)))return E;var ce=ml(E),Ce=hc(ce,ml(D));return Xu(ce,Ce).join("")}function _v(E,D){var Z=Be,ce=Te;if(ha(D)){var Ce="separator"in D?D.separator:Ce;Z="length"in D?cr(D.length):Z,ce="omission"in D?gi(D.omission):ce}E=vi(E);var ze=E.length;if(Oa(E)){var it=ml(E);ze=it.length}if(Z>=ze)return E;var bt=Z-pd(ce);if(bt<1)return ce;var Lt=it?Xu(it,0,bt).join(""):E.slice(0,bt);if(Ce===n)return Lt+ce;if(it&&(bt+=Lt.length-bt),x1(Ce)){if(E.slice(bt).search(Ce)){var wn,_n=Lt;for(Ce.global||(Ce=rh(Ce.source,vi(Ge.exec(Ce))+"g")),Ce.lastIndex=0;wn=Ce.exec(_n);)var Bn=wn.index;Lt=Lt.slice(0,Bn===n?bt:Bn)}}else if(E.indexOf(gi(Ce),bt)!=bt){var yo=Lt.lastIndexOf(Ce);yo>-1&&(Lt=Lt.slice(0,yo))}return Lt+ce}function wv(E){return E=vi(E),E&&Xr.test(E)?E.replace(nn,qe):E}var Sv=yh(function(E,D,Z){return E+(Z?" ":"")+D.toUpperCase()}),Hb=Kp("toUpperCase");function Qb(E,D,Z){return E=vi(E),D=Z?n:D,D===n?tu(E)?Cf(E):th(E):E.match(D)||[]}var gy=Xs(function(E,D){try{return yr(E,n,D)}catch(Z){return lv(Z)?Z:new ps(Z)}}),Vb=wh(function(E,D){return Jo(D,function(Z){Z=lu(Z),ru(E,Z,wa(E[Z],E))}),E});function zb(E){var D=E==null?0:E.length,Z=ls();return E=D?Ni(E,function(ce){if(typeof ce[1]!="function")throw new Ui(h);return[Z(ce[0]),ce[1]]}):[],Xs(function(ce){for(var Ce=-1;++Ce<D;){var ze=E[Ce];if(yr(ze[0],this,ce))return yr(ze[1],this,ce)}})}function Bw(E){return wl(Ei(E,A))}function D1(E){return function(){return E}}function by(E,D){return E==null||E!==E?D:E}var Lw=tg(),Cv=tg(!0);function Du(E){return E}function _m(E){return z(typeof E=="function"?E:Ei(E,A))}function Fw(E){return Vt(Ei(E,A))}function kv(E,D){return gn(E,Ei(D,A))}var Hw=Xs(function(E,D){return function(Z){return xu(Z,E,D)}}),Qw=Xs(function(E,D){return function(Z){return xu(E,Z,D)}});function xv(E,D,Z){var ce=xl(D),Ce=am(D,ce);Z==null&&!(ha(D)&&(Ce.length||!ce.length))&&(Z=D,D=E,E=this,Ce=am(D,xl(D)));var ze=!(ha(Z)&&"chain"in Z)||!!Z.chain,it=Lf(E);return Jo(Ce,function(bt){var Lt=D[bt];E[bt]=Lt,it&&(E.prototype[bt]=function(){var wn=this.__chain__;if(ze||wn){var _n=E(this.__wrapped__),Bn=_n.__actions__=ec(this.__actions__);return Bn.push({func:Lt,args:arguments,thisArg:E}),_n.__chain__=wn,_n}return Lt.apply(E,Vu([this.value()],arguments))})}),E}function vy(){return me._===this&&(me._=ih),this}function Ev(){}function bl(E){return E=cr(E),Xs(function(D){return Uo(D,E)})}var iC=ng(Ni),Dg=ng(Fr),Wb=ng(eu);function Tv(E){return kh(E)?va(lu(E)):gc(E)}function Av(E){return function(D){return E==null?n:tl(E,D)}}var Oy=cb(),yy=cb(!0);function Nh(){return[]}function bp(){return!1}function Vw(){return{}}function zw(){return""}function R1(){return!0}function $v(E,D){if(E=cr(E),E<1||E>je)return[];var Z=Ue,ce=Ia(E,Ue);D=ls(D),E-=Ue;for(var Ce=Sr(ce,D);++Z<E;)D(Z);return Ce}function _y(E){return os(E)?Ni(E,lu):ji(E)?[E]:ec(Qc(vi(E)))}function Ua(E){var D=++Pc;return vi(E)+D}var wy=Td(function(E,D){return E+D},0),Pv=m1("ceil"),aC=Td(function(E,D){return E/D},1),Rg=m1("floor");function Ww(E){return E&&E.length?Sl(E,Du,rf):n}function Sy(E,D){return E&&E.length?Sl(E,ls(D,2),rf):n}function Dv(E){return Ra(E,Du)}function M1(E,D){return Ra(E,ls(D,2))}function Zb(E){return E&&E.length?Sl(E,Du,Ae):n}function Mg(E,D){return E&&E.length?Sl(E,ls(D,2),Ae):n}var Zw=Td(function(E,D){return E*D},1),wm=m1("round"),Cy=Td(function(E,D){return E-D},0);function Sm(E){return E&&E.length?_f(E,Du):0}function Cm(E,D){return E&&E.length?_f(E,ls(D,2)):0}return xe.after=Er,xe.ary=Cg,xe.assign=vw,xe.assignIn=Vl,xe.assignInWith=Om,xe.assignW
2024-08-22 17:59:06 +03:00
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/var objectToString=Object.prototype.toString,isArray=Array.isArray||function(e){return objectToString.call(e)==="[object Array]"};function isFunction(o){return typeof o=="function"}function typeStr(o){return isArray(o)?"array":typeof o}function escapeRegExp(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(o,e){return o!=null&&typeof o=="object"&&e in o}function primitiveHasOwnProperty(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var regExpTest=RegExp.prototype.test;function testRegExp(o,e){return regExpTest.call(o,e)}var nonSpaceRe=/\S/;function isWhitespace(o){return!testRegExp(nonSpaceRe,o)}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function escapeHtml(o){return String(o).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})}var whiteRe=/\s*/,spaceRe=/\s+/,equalsRe=/\s*=/,curlyRe=/\s*\}/,tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(o,e){if(!o)return[];var n=!1,r=[],c=[],u=[],h=!1,p=!1,b="",y=0;function k(){if(h&&!p)for(;u.length;)delete c[u.pop()];else u=[];h=!1,p=!1}var A,R,N;function F(Se){if(typeof Se=="string"&&(Se=Se.split(spaceRe,2)),!isArray(Se)||Se.length!==2)throw new Error("Invalid tags: "+Se);A=new RegExp(escapeRegExp(Se[0])+"\\s*"),R=new RegExp("\\s*"+escapeRegExp(Se[1])),N=new RegExp("\\s*"+escapeRegExp("}"+Se[1]))}F(e||mustache.tags);for(var V=new Scanner(o),W,J,te,j,ae,fe;!V.eos();){if(W=V.pos,te=V.scanUntil(A),te)for(var _e=0,ne=te.length;_e<ne;++_e)j=te.charAt(_e),isWhitespace(j)?(u.push(c.length),b+=j):(p=!0,n=!0,b+=" "),c.push(["text",j,W,W+1]),W+=1,j===`
`&&(k(),b="",y=0,n=!1);if(!V.scan(A))break;if(h=!0,J=V.scan(tagRe)||"name",V.scan(whiteRe),J==="="?(te=V.scanUntil(equalsRe),V.scan(equalsRe),V.scanUntil(R)):J==="{"?(te=V.scanUntil(N),V.scan(curlyRe),V.scanUntil(R),J="&"):te=V.scanUntil(R),!V.scan(R))throw new Error("Unclosed tag at "+V.pos);if(J==">"?ae=[J,te,W,V.pos,b,y,n]:ae=[J,te,W,V.pos],y++,c.push(ae),J==="#"||J==="^")r.push(ae);else if(J==="/"){if(fe=r.pop(),!fe)throw new Error('Unopened section "'+te+'" at '+W);if(fe[1]!==te)throw new Error('Unclosed section "'+fe[1]+'" at '+W)}else J==="name"||J==="{"||J==="&"?p=!0:J==="="&&F(te)}if(k(),fe=r.pop(),fe)throw new Error('Unclosed section "'+fe[1]+'" at '+V.pos);return nestTokens(squashTokens(c))}function squashTokens(o){for(var e=[],n,r,c=0,u=o.length;c<u;++c)n=o[c],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(e.push(n),r=n));return e}function nestTokens(o){for(var e=[],n=e,r=[],c,u,h=0,p=o.length;h<p;++h)switch(c=o[h],c[0]){case"#":case"^":n.push(c),r.push(c),n=c[4]=[];break;case"/":u=r.pop(),u[5]=c[2],n=r.length>0?r[r.length-1][4]:e;break;default:n.push(c)}return e}function Scanner(o){this.string=o,this.tail=o,this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(e){var n=this.tail.match(e);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};Scanner.prototype.scanUntil=function(e){var n=this.tail.search(e),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};function Context$1(o,e){this.view=o,this.cache={".":this.view},this.parent=e}Context$1.prototype.push=function(e){return new Context$1(e,this)};Context$1.prototype.lookup=function(e){var n=this.cache,r;if(n.hasOwnProperty(e))r=n[e];else{for(var c=this,u,h,p,b=!1;c;){if(e.indexOf(".")>0)for(u=c.view,h=e.split("."),p=0;u!=null&&p<h.length;)p===h.length-1&&(b=hasProperty(u,h[p])||primitiveHasOwnProperty(u,h[p])),u=u[h[p++]];else u=c.view[e],b=hasProperty(c.view,e);if(b){r=u;break}c=c.parent}n[e]=r}return isFunction(r)&&(r=r.call(this.view)),r};function Writer(){this.templateCache={_cache:{},set:function(e,n){this._cache[e]=n},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Writer.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Writer.prototype.parse=function(e,n){var r=this.templateCache,c=e+":"+(n||mustache.tags).join(":"),u=typeof r<"u",h=u?r.get(c):void 0;return h==null&&(h=parseTemplate(e,n),u&&r.set(c,h)),h};Writer.prototype.render=function(e,n,r,c){var u=this.getConfigTags(c),h=this.parse(e,u),p=n instanceof Context$1?n:new Context$1(n,void 0);return this.renderTokens(h,p,r,e,c)};Writer.prototype.renderTokens=function(e,n,r,c,u){for(var h="",p,b,y,k=0,A=e.length;k<A;++k)y=void 0,p=e[k],b=p[0],b==="#"?y=this.renderSection(p,n,r,c,u):b==="^"?y=this.renderInverted(p,n,r,c,u):b===">"?y=this.renderPartial(p,n,r,u):b==="&"?y=this.unescapedValue(p,n):b==="name"?y=this.escapedValue(p,n,u):b==="text"&&(y=this.rawValue(p)),y!==void 0&&(h+=y);return h};Writer.prototype.renderSection=function(e,n,r,c,u){var h=this,p="",b=n.lookup(e[1]);function y(R){return h.render(R,n,r,u)}if(b){if(isArray(b))for(var k=0,A=b.length;k<A;++k)p+=this.renderTokens(e[4],n.push(b[k]),r,c,u);else if(typeof b=="object"||typeof b=="string"||typeof b=="number")p+=this.renderTokens(e[4],n.push(b),r,c,u);else if(isFunction(b)){if(typeof c!="string")throw new Error("Cannot use higher-order sections without the original template");b=b.call(n.view,c.slice(e[3],e[5]),y),b!=null&&(p+=b)}else p+=this.renderTokens(e[4],n,r,c,u);return p}};Writer.prototype.renderInverted=function(e,n,r,c,u){var h=n.lookup(e[1]);if(!h||isArray(h)&&h.length===0)return this.renderTokens(e[4],n,r,c,u)};Writer.prototype.indentPartial=function(e,n,r){for(var c=n.replace(/[^ \t]/g,""),u=e.split(`
`),h=0;h<u.length;h++)u[h].length&&(h>0||!r)&&(u[h]=c+u[h]);return u.join(`
`)};Writer.prototype.renderPartial=function(e,n,r,c){if(r){var u=this.getConfigTags(c),h=isFunction(r)?r(e[1]):r[e[1]];if(h!=null){var p=e[6],b=e[5],y=e[4],k=h;b==0&&y&&(k=this.indentPartial(h,y,p));var A=this.parse(k,u);return this.renderTokens(A,n,r,k,c)}}};Writer.prototype.unescapedValue=function(e,n){var r=n.lookup(e[1]);if(r!=null)return r};Writer.prototype.escapedValue=function(e,n,r){var c=this.getConfigEscape(r)||mustache.escape,u=n.lookup(e[1]);if(u!=null)return typeof u=="number"&&c===mustache.escape?String(u):c(u)};Writer.prototype.rawValue=function(e){return e[1]};Writer.prototype.getConfigTags=function(e){return isArray(e)?e:e&&typeof e=="object"?e.tags:void 0};Writer.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!isArray(e))return e.escape};var mustache={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){defaultWriter.templateCache=o},get templateCache(){return defaultWriter.templateCache}},defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(e,n){return defaultWriter.parse(e,n)};mustache.render=function(e,n,r,c){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+typeStr(e)+'" was given as the first argument for mustache#render(template, view, partials)');return defaultWriter.render(e,n,r,c)};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context$1;mustache.Writer=Writer;function previewTitle(o,e,n){let r=o.find(h=>h.name===(e==null?void 0:e.schema));if(!(r!=null&&r.cardTitle))return noTemplate(r,e);let c=e.data,u=mustache.render(r.cardTitle,c);return!u||u===""?noTemplate(r,e):stripHtml(u.slice(0,300))}function noTemplate(o,e){var r;if((o==null?void 0:o.type)==="files")return e._file.path;let n=stripHtml(e==null?void 0:e.data[(r=o.fields.filter(c=>c.info.name==="text")[0])==null?void 0:r.name]).slice(0,300);return n.trim()===""?"~Untitled~":n}function create_else_block$j(o){let e;return{c(){e=text("New Record")},m(n,r){insert$1(n,e,r)},p:noop,d(n){n&&detach(e)}}}function create_if_block$J(o){let e=previewTitle(o[3].schemas,o[1])+"",n;return{c(){n=text(e)},m(r,c){insert$1(r,n,c)},p(r,c){c&2&&e!==(e=previewTitle(r[3].schemas,r[1])+"")&&set_data(n,e)},d(r){r&&detach(n)}}}function create_fragment$13(o){let e,n,r=o[0].label.toUpperCase()+"",c,u,h,p;function b(A,R){return A[2]?create_else_block$j:create_if_block$J}let y=b(o),k=y(o);return{c(){e=element("div"),n=element("a"),c=text(r),h=space$3(),p=element("span"),k.c(),attr(n,"class","schema-name"),attr(n,"href",u=o[3].lucentUrl+"/content/"+o[0].name),attr(p,"class","record-title"),attr(e,"class","record-header")},m(A,R){insert$1(A,e,R),append(e,n),append(n,c),append(e,h),append(e,p),k.m(p,null)},p(A,[R]){R&1&&r!==(r=A[0].label.toUpperCase()+"")&&set_data(c,r),R&1&&u!==(u=A[3].lucentUrl+"/content/"+A[0].name)&&attr(n,"href",u),y===(y=b(A))&&k?k.p(A,R):(k.d(1),k=y(A),k&&(k.c(),k.m(p,null)))},i:noop,o:noop,d(A){A&&detach(e),k.d()}}}function instance$13(o,e,n){const r=getContext$1("channel");let{schema:c}=e,{record:u}=e,{isCreateMode:h}=e;return o.$$set=p=>{"schema"in p&&n(0,c=p.schema),"record"in p&&n(1,u=p.record),"isCreateMode"in p&&n(2,h=p.isCreateMode)},[c,u,h,r]}class Title extends SvelteComponent{constructor(e){super(),init(this,e,instance$13,create_fragment$13,safe_not_equal,{schema:0,record:1,isCreateMode:2})}}function get_each_context$l(o,e,n){const r=o.slice();return r[24]=e[n],r}function create_if_block_2$b(o){let e,n,r;return{c(){e=element("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Save`,attr(e,"type","button"),attr(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",o[10]),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_if_block_1$n(o){let e,n,r;return{c(){e=element("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
2024-08-23 18:15:18 +03:00
Create`,attr(e,"class","button primary btn-spinner")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",o[10]),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_if_block$I(o){let e,n,r,c;function u(b){o[14](b)}function h(b){o[15](b)}let p={field:o[24],schema:o[2],record:o[0],validationErrors:o[4],isCreateMode:o[3]};return o[0].data!==void 0&&(p.data=o[0].data),o[1]!==void 0&&(p.graph=o[1]),e=new FormField({props:p}),binding_callbacks.push(()=>bind(e,"data",u)),binding_callbacks.push(()=>bind(e,"graph",h)),{c(){create_component(e.$$.fragment)},m(b,y){mount_component(e,b,y),c=!0},p(b,y){const k={};y&4&&(k.schema=b[2]),y&1&&(k.record=b[0]),y&16&&(k.validationErrors=b[4]),y&8&&(k.isCreateMode=b[3]),!n&&y&1&&(n=!0,k.data=b[0].data,add_flush_callback(()=>n=!1)),!r&&y&2&&(r=!0,k.graph=b[1],add_flush_callback(()=>r=!1)),e.$set(k)},i(b){c||(transition_in(e.$$.fragment,b),c=!0)},o(b){transition_out(e.$$.fragment,b),c=!1},d(b){destroy_component(e,b)}}}function create_each_block$l(o,e){let n,r,c,u=e[5]===e[24].group&&create_if_block$I(e);return{key:o,first:null,c(){n=empty$1(),u&&u.c(),r=empty$1(),this.first=n},m(h,p){insert$1(h,n,p),u&&u.m(h,p),insert$1(h,r,p),c=!0},p(h,p){e=h,e[5]===e[24].group?u?(u.p(e,p),p&32&&transition_in(u,1)):(u=create_if_block$I(e),u.c(),transition_in(u,1),u.m(r.parentNode,r)):u&&(group_outros(),transition_out(u,1,1,()=>{u=null}),check_outros())},i(h){c||(transition_in(u),c=!0)},o(h){transition_out(u),c=!1},d(h){h&&(detach(n),detach(r)),u&&u.d(h)}}}function create_fragment$12(o){let e,n,r,c,u,h,p,b,y,k,A,R,N,F,V,W,J,te=[],j=new Map,ae,fe,_e;function ne(Le){o[11](Le)}function Se(Le){o[12](Le)}let De={schema:o[2],isCreateMode:o[3]};o[0]!==void 0&&(De.record=o[0]),o[5]!==void 0&&(De.activeContentTab=o[5]),r=new EditHeader({props:De}),binding_callbacks.push(()=>bind(r,"record",ne)),binding_callbacks.push(()=>bind(r,"activeContentTab",Se));function Be(Le,je){if(Le[3])return create_if_block_1$n;if(Le[6])return create_if_block_2$b}let Te=Be(o),Oe=Te&&Te(o);b=new Title({props:{schema:o[2],record:o[0],isCreateMode:o[3]}}),k=new ErrorAlert({props:{message:o[7]}});function yt(Le){o[13](Le)}let Tt={schema:o[2],isCreateMode:o[3]};o[5]!==void 0&&(Tt.active=o[5]),N=new ContentTabs({props:Tt}),binding_callbacks.push(()=>bind(N,"active",yt)),W=new FilePreview({props:{record:o[0],schema:o[2]}});let St=ensure_array_like(o[8]);const q=Le=>Le[24].name;for(let Le=0;Le<St.length;Le+=1){let je=get_each_context$l(o,St,Le),mn=q(je);j.set(mn,te[Le]=create_each_block$l(mn,je))}return{c(){e=element("div"),n=element("div"),create_component(r.$$.fragment),h=space$3(),Oe&&Oe.c(),p=space$3(),create_component(b.$$.fragment),y=space$3(),create_component(k.$$.fragment),A=space$3(),R=element("div"),create_component(N.$$.fragment),V=space$3(),create_component(W.$$.fragment),J=space$3();for(let Le=0;Le<te.length;Le+=1)te[Le].c();attr(n,"class","tools-header"),attr(R,"class","mt-4"),set_style(R,"margin-bottom","150px"),set_style(R,"position","relative"),attr(e,"class","inline-edit record-edit")},m(Le,je){insert$1(Le,e,je),append(e,n),mount_component(r,n,null),append(n,h),Oe&&Oe.m(n,null),append(e,p),mount_component(b,e,null),append(e,y),mount_component(k,e,null),append(e,A),append(e,R),mount_component(N,R,null),append(R,V),mount_component(W,R,null),append(R,J);for(let mn=0;mn<te.length;mn+=1)te[mn]&&te[mn].m(R,null);ae=!0,fe||(_e=listen(window,"beforeunload",o[9]),fe=!0)},p(Le,[je]){const mn={};je&4&&(mn.schema=Le[2]),je&8&&(mn.isCreateMode=Le[3]),!c&&je&1&&(c=!0,mn.record=Le[0],add_flush_callback(()=>c=!1)),!u&&je&32&&(u=!0,mn.activeContentTab=Le[5],add_flush_callback(()=>u=!1)),r.$set(mn),Te===(Te=Be(Le))&&Oe?Oe.p(Le,je):(Oe&&Oe.d(1),Oe=Te&&Te(Le),Oe&&(Oe.c(),Oe.m(n,null)));const Rt={};je&4&&(Rt.schema=Le[2]),je&1&&(Rt.record=Le[0]),je&8&&(Rt.isCreateMode=Le[3]),b.$set(Rt);const Ue={};je&128&&(Ue.message=Le[7]),k.$set(Ue);const ct={};je&4&&(ct.schema=Le[2]),je&8&&(ct.isCreateMode=Le[3]),!F&&je&32&&(F=!0,ct.active=Le[5],add_flush_callback(()=>F=!1)),N.$set(ct);const dn={};je&1&&(dn.record=Le[0]),je&4&&(dn.schema=Le[2]),W.$s
2024-08-22 17:59:06 +03:00
`,attr(e,"class","start-typing")},m(n,r){insert$1(n,e,r)},p:noop,d(n){n&&detach(e)}}}function create_each_block$k(o,e){let n,r=previewTitle(e[3].schemas,e[11])+"",c,u,h,p;function b(...k){return e[8](e[11],...k)}function y(...k){return e[9](e[11],...k)}return{key:o,first:null,c(){n=element("div"),c=text(r),u=space$3(),attr(n,"class","reference-tags-option"),attr(n,"role","button"),attr(n,"tabindex","0"),this.first=n},m(k,A){insert$1(k,n,A),append(n,c),append(n,u),h||(p=[listen(n,"click",b),listen(n,"keypress",y)],h=!0)},p(k,A){e=k,A&4&&r!==(r=previewTitle(e[3].schemas,e[11])+"")&&set_data(c,r)},d(k){k&&detach(n),h=!1,run_all(p)}}}function create_fragment$11(o){let e,n,r,c,u,h,p,b=o[2]&&create_if_block$H(o);return{c(){e=element("div"),n=element("input"),c=space$3(),u=element("div"),b&&b.c(),attr(n,"type","search"),attr(n,"placeholder",r="Search for "+o[0].label),attr(n,"autocomplete","off"),attr(u,"class","reference-tags-results"),attr(e,"class","reference-tags")},m(y,k){insert$1(y,e,k),append(e,n),set_input_value(n,o[1]),append(e,c),append(e,u),b&&b.m(u,null),h||(p=[listen(n,"keyup",o[4]),listen(n,"input",o[7])],h=!0)},p(y,[k]){k&1&&r!==(r="Search for "+y[0].label)&&attr(n,"placeholder",r),k&2&&n.value!==y[1]&&set_input_value(n,y[1]),y[2]?b?b.p(y,k):(b=create_if_block$H(y),b.c(),b.m(u,null)):b&&(b.d(1),b=null)},i:noop,o:noop,d(y){y&&detach(e),b&&b.d(),h=!1,run_all(p)}}}function instance$11(o,e,n){let r;const c=getContext$1("channel"),u=createEventDispatcher();let{value:h=""}=e,{field:p}=e,b="";const y=lodashExports.debounce(F=>{axios.get(c.lucentUrl+"/records/suggestions",{params:{schema:p.collections[0],field:"search",value:b,ui:"search"}}).then(V=>{n(2,r=V.data)}).catch(V=>{n(2,r=[]),console.log(V)})},500);function k(F,V){F.preventDefault(),n(6,h=V.id),u("addFilter"),n(6,h="")}function A(){b=this.value,n(1,b)}const R=(F,V)=>k(V,F),N=(F,V)=>k(V,F);return o.$$set=F=>{"value"in F&&n(6,h=F.value),"field"in F&&n(0,p=F.field)},n(2,r=[]),[p,b,r,c,y,k,h,A,R,N]}class FilterReferenceInput extends SvelteComponent{constructor(e){super(),init(this,e,instance$11,create_fragment$11,safe_not_equal,{value:6,field:0})}}function get_each_context$j(o,e,n){const r=o.slice();return r[38]=e[n],r}function get_each_context_1$6(o,e,n){const r=o.slice();return r[41]=e[n],r}function get_each_context_2$2(o,e,n){const r=o.slice();return r[38]=e[n],r}function create_if_block_4$5(o){let e,n,r,c,u,h,p,b;n=new Icon({props:{icon:"arrow-left"}});let y=ensure_array_like(o[9]),k=[];for(let A=0;A<y.length;A+=1)k[A]=create_each_block_2$2(get_each_context_2$2(o,y,A));return{c(){e=element("button"),create_component(n.$$.fragment),r=text(`
Back`),c=space$3();for(let A=0;A<k.length;A+=1)k[A].c();u=empty$1(),attr(e,"class","dropdown-item button")},m(A,R){insert$1(A,e,R),mount_component(n,e,null),append(e,r),insert$1(A,c,R);for(let N=0;N<k.length;N+=1)k[N]&&k[N].m(A,R);insert$1(A,u,R),h=!0,p||(b=listen(e,"click",o[22]),p=!0)},p(A,R){if(R[0]&2560){y=ensure_array_like(A[9]);let N;for(N=0;N<y.length;N+=1){const F=get_each_context_2$2(A,y,N);k[N]?k[N].p(F,R):(k[N]=create_each_block_2$2(F),k[N].c(),k[N].m(u.parentNode,u))}for(;N<k.length;N+=1)k[N].d(1);k.length=y.length}},i(A){h||(transition_in(n.$$.fragment,A),h=!0)},o(A){transition_out(n.$$.fragment,A),h=!1},d(A){A&&(detach(e),detach(c),detach(u)),destroy_component(n),destroy_each(k,A),p=!1,b()}}}function create_each_block_2$2(o){let e,n,r;function c(...u){return o[23](o[38],...u)}return{c(){e=element("button"),e.textContent=`${o[38].label} `,attr(e,"class","dropdown-item button")},m(u,h){insert$1(u,e,h),n||(r=listen(e,"click",c),n=!0)},p(u,h){o=u},d(u){u&&detach(e),n=!1,r()}}}function create_if_block_3$8(o){let e,n,r,c,u,h,p=o[3].label+"",b,y,k,A,R,N;n=new Icon({props:{icon:"arrow-left"}});let F=ensure_array_like(o[7]),V=[];for(let W=0;W<F.length;W+=1)V[W]=create_each_block_1$6(get_each_context_1$6(o,F,W));return{c(){e=element("button"),create_component(n.$$.fragment),r=text(`
Back`),c=space$3(),u=element("div"),h=text("field: "),b=text(p),y=space$3();for(let W=0;W<V.length;W+=1)V[W].c();k=empty$1(),attr(e,"class","dropdown-item button"),attr(u,"class","selected-filter")},m(W,J){insert$1(W,e,J),mount_component(n,e,null),append(e,r),insert$1(W,c,J),insert$1(W,u,J),append(u,h),append(u,b),insert$1(W,y,J);for(let te=0;te<V.length;te+=1)V[te]&&V[te].m(W,J);insert$1(W,k,J),A=!0,R||(N=listen(e,"click",o[24]),R=!0)},p(W,J){if((!A||J[0]&8)&&p!==(p=W[3].label+"")&&set_data(b,p),J[0]&160){F=ensure_array_like(W[7]);let te;for(te=0;te<F.length;te+=1){const j=get_each_context_1$6(W,F,te);V[te]?V[te].p(j,J):(V[te]=create_each_block_1$6(j),V[te].c(),V[te].m(k.parentNode,k))}for(;te<V.length;te+=1)V[te].d(1);V.length=F.length}},i(W){A||(transition_in(n.$$.fragment,W),A=!0)},o(W){transition_out(n.$$.fragment,W),A=!1},d(W){W&&(detach(e),detach(c),detach(u),detach(y),detach(k)),destroy_component(n),destroy_each(V,W),R=!1,N()}}}function create_each_block_1$6(o){let e,n=o[41].label+"",r,c,u,h;function p(...b){return o[25](o[41],...b)}return{c(){e=element("button"),r=text(n),c=space$3(),attr(e,"class","dropdown-item button")},m(b,y){insert$1(b,e,y),append(e,r),append(e,c),u||(h=listen(e,"click",p),u=!0)},p(b,y){o=b,y[0]&128&&n!==(n=o[41].label+"")&&set_data(r,n)},d(b){b&&detach(e),u=!1,h()}}}function create_if_block_2$a(o){let e,n,r,c,u,h,p=o[3].label+"",b,y,k=o[5].label+"",A,R,N,F,V,W,J,te,j;return n=new Icon({props:{icon:"arrow-left"}}),{c(){e=element("button"),create_component(n.$$.fragment),r=text(`
Back`),c=space$3(),u=element("div"),h=text("field: "),b=text(p),y=text(" operator: "),A=text(k),R=space$3(),N=element("div"),F=element("input"),V=space$3(),W=element("button"),W.textContent="Add filter",attr(e,"class","dropdown-item button"),attr(u,"class","selected-filter"),attr(F,"type","text"),attr(F,"class","form-control"),attr(N,"class","filter-input"),attr(W,"class","button applied-filter"),attr(W,"type","button")},m(ae,fe){insert$1(ae,e,fe),mount_component(n,e,null),append(e,r),insert$1(ae,c,fe),insert$1(ae,u,fe),append(u,h),append(u,b),append(u,y),append(u,A),insert$1(ae,R,fe),insert$1(ae,N,fe),append(N,F),set_input_value(F,o[2]),insert$1(ae,V,fe),insert$1(ae,W,fe),J=!0,te||(j=[listen(e,"click",o[26]),listen(F,"input",o[27]),listen(W,"click",o[13])],te=!0)},p(ae,fe){(!J||fe[0]&8)&&p!==(p=ae[3].label+"")&&set_data(b,p),(!J||fe[0]&32)&&k!==(k=ae[5].label+"")&&set_data(A,k),fe[0]&4&&F.value!==ae[2]&&set_input_value(F,ae[2])},i(ae){J||(transition_in(n.$$.fragment,ae),J=!0)},o(ae){transition_out(n.$$.fragment,ae),J=!1},d(ae){ae&&(detach(e),detach(c),detach(u),detach(R),detach(N),detach(V),detach(W)),destroy_component(n),te=!1,run_all(j)}}}function create_if_block_1$m(o){let e,n,r,c,u,h,p,b;n=new Icon({props:{icon:"arrow-left"}});let y=ensure_array_like(o[10]),k=[];for(let A=0;A<y.length;A+=1)k[A]=create_each_block$j(get_each_context$j(o,y,A));return{c(){e=element("button"),create_component(n.$$.fragment),r=text(`
Back`),c=space$3();for(let A=0;A<k.length;A+=1)k[A].c();u=empty$1(),attr(e,"class","dropdown-item button")},m(A,R){insert$1(A,e,R),mount_component(n,e,null),append(e,r),insert$1(A,c,R);for(let N=0;N<k.length;N+=1)k[N]&&k[N].m(A,R);insert$1(A,u,R),h=!0,p||(b=listen(e,"click",o[28]),p=!0)},p(A,R){if(R[0]&5120){y=ensure_array_like(A[10]);let N;for(N=0;N<y.length;N+=1){const F=get_each_context$j(A,y,N);k[N]?k[N].p(F,R):(k[N]=create_each_block$j(F),k[N].c(),k[N].m(u.parentNode,u))}for(;N<k.length;N+=1)k[N].d(1);k.length=y.length}},i(A){h||(transition_in(n.$$.fragment,A),h=!0)},o(A){transition_out(n.$$.fragment,A),h=!1},d(A){A&&(detach(e),detach(c),detach(u)),destroy_component(n),destroy_each(k,A),p=!1,b()}}}function create_each_block$j(o){let e,n,r;function c(...u){return o[29](o[38],...u)}return{c(){e=element("button"),e.textContent=`${o[38].label} `,attr(e,"class","dropdown-item button")},m(u,h){insert$1(u,e,h),n||(r=listen(e,"click",c),n=!0)},p(u,h){o=u},d(u){u&&detach(e),n=!1,r()}}}function create_if_block$G(o){let e,n,r,c,u,h,p=o[4].label+"",b,y,k,A,R,N,F,V;n=new Icon({props:{icon:"arrow-left"}});function W(te){o[31](te)}let J={field:o[4]};return o[2]!==void 0&&(J.value=o[2]),A=new FilterReferenceInput({props:J}),binding_callbacks.push(()=>bind(A,"value",W)),A.$on("addFilter",o[13]),{c(){e=element("button"),create_component(n.$$.fragment),r=text(`
2024-08-23 18:15:18 +03:00
Back`),c=space$3(),u=element("div"),h=text("field: "),b=text(p),y=space$3(),k=element("div"),create_component(A.$$.fragment),attr(e,"class","dropdown-item button"),attr(u,"class","selected-filter"),attr(k,"class","mt-2")},m(te,j){insert$1(te,e,j),mount_component(n,e,null),append(e,r),insert$1(te,c,j),insert$1(te,u,j),append(u,h),append(u,b),insert$1(te,y,j),insert$1(te,k,j),mount_component(A,k,null),N=!0,F||(V=listen(e,"click",o[30]),F=!0)},p(te,j){(!N||j[0]&16)&&p!==(p=te[4].label+"")&&set_data(b,p);const ae={};j[0]&16&&(ae.field=te[4]),!R&&j[0]&4&&(R=!0,ae.value=te[2],add_flush_callback(()=>R=!1)),A.$set(ae)},i(te){N||(transition_in(n.$$.fragment,te),transition_in(A.$$.fragment,te),N=!0)},o(te){transition_out(n.$$.fragment,te),transition_out(A.$$.fragment,te),N=!1},d(te){te&&(detach(e),detach(c),detach(u),detach(y),detach(k)),destroy_component(n),destroy_component(A),F=!1,V()}}}function create_default_slot$7(o){let e,n,r,c,u,h,p,b,y,k,A,R,N,F,V,W,J,te,j,ae,fe,_e,ne,Se,De,Be,Te=!o[3]&&create_if_block_4$5(o),Oe=o[3]&&!o[5]&&create_if_block_3$8(o),yt=o[3]&&o[5]&&create_if_block_2$a(o),Tt=!o[4]&&create_if_block_1$m(o),St=o[4]&&create_if_block$G(o);return J=new Icon({props:{icon:"arrow-left"}}),{c(){e=element("div"),n=element("button"),n.textContent="Filter by field",r=space$3(),c=element("button"),c.textContent="Filter by Reference",u=space$3(),h=element("button"),h.textContent="Advanced filter",p=space$3(),b=element("div"),Te&&Te.c(),y=space$3(),Oe&&Oe.c(),k=space$3(),yt&&yt.c(),A=space$3(),R=element("div"),Tt&&Tt.c(),N=space$3(),St&&St.c(),F=space$3(),V=element("div"),W=element("button"),create_component(J.$$.fragment),te=text(`
Back`),j=space$3(),ae=element("form"),fe=element("input"),_e=space$3(),ne=element("button"),ne.textContent="Submit",attr(n,"class","dropdown-item button"),attr(c,"class","dropdown-item button"),attr(h,"class","dropdown-item button"),toggle_class(e,"hide",o[6]!=="main"),toggle_class(b,"hide",o[6]!=="byField"),toggle_class(R,"hide",o[6]!=="byReference"),attr(W,"class","dropdown-item button"),attr(fe,"type","search"),attr(fe,"class","mb-2 mt-2"),attr(fe,"placeholder","Advanced filters"),fe.required=!0,attr(ne,"class","button applied-filter"),toggle_class(V,"hide",o[6]!=="advanced")},m(q,Le){insert$1(q,e,Le),append(e,n),append(e,r),append(e,c),append(e,u),append(e,h),insert$1(q,p,Le),insert$1(q,b,Le),Te&&Te.m(b,null),append(b,y),Oe&&Oe.m(b,null),append(b,k),yt&&yt.m(b,null),insert$1(q,A,Le),insert$1(q,R,Le),Tt&&Tt.m(R,null),append(R,N),St&&St.m(R,null),insert$1(q,F,Le),insert$1(q,V,Le),append(V,W),mount_component(J,W,null),append(W,te),append(V,j),append(V,ae),append(ae,fe),set_input_value(fe,o[1]),append(ae,_e),append(ae,ne),Se=!0,De||(Be=[listen(n,"click",o[19]),listen(c,"click",o[20]),listen(h,"click",o[21]),listen(W,"click",o[32]),listen(fe,"input",o[33]),listen(ae,"submit",o[8])],De=!0)},p(q,Le){(!Se||Le[0]&64)&&toggle_class(e,"hide",q[6]!=="main"),q[3]?Te&&(group_outros(),transition_out(Te,1,1,()=>{Te=null}),check_outros()):Te?(Te.p(q,Le),Le[0]&8&&transition_in(Te,1)):(Te=create_if_block_4$5(q),Te.c(),transition_in(Te,1),Te.m(b,y)),q[3]&&!q[5]?Oe?(Oe.p(q,Le),Le[0]&40&&transition_in(Oe,1)):(Oe=create_if_block_3$8(q),Oe.c(),transition_in(Oe,1),Oe.m(b,k)):Oe&&(group_outros(),transition_out(Oe,1,1,()=>{Oe=null}),check_outros()),q[3]&&q[5]?yt?(yt.p(q,Le),Le[0]&40&&transition_in(yt,1)):(yt=create_if_block_2$a(q),yt.c(),transition_in(yt,1),yt.m(b,null)):yt&&(group_outros(),transition_out(yt,1,1,()=>{yt=null}),check_outros()),(!Se||Le[0]&64)&&toggle_class(b,"hide",q[6]!=="byField"),q[4]?Tt&&(group_outros(),transition_out(Tt,1,1,()=>{Tt=null}),check_outros()):Tt?(Tt.p(q,Le),Le[0]&16&&transition_in(Tt,1)):(Tt=create_if_block_1$m(q),Tt.c(),transition_in(Tt,1),Tt.m(R,N)),q[4]?St?(St.p(q,Le),Le[0]&16&&transition_in(St,1)):(St=create_if_block$G(q),St.c(),transition_in(St,1),St.m(R,null)):St&&(group_outros(),transition_out(St,1,1,()=>{St=null}),check_outros()),(!Se||Le[0]&64)&&toggle_class(R,"hide",q[6]!=="byReference"),Le[0]&2&&fe.value!==q[1]&&set_input_value(fe,q[1]),(!Se||Le[0]&64)&&toggle_class(V,"hide",q[6]!=="advanced")},i(q){Se||(transition_in(Te),transition_in(Oe),transition_in(yt),transition_in(Tt),transition_in(St),transition_in(J.$$.fragment,q),Se=!0)},o(q){transition_out(Te),transition_out(Oe),transition_out(yt),transition_out(Tt),transition_out(St),transition_out(J.$$.fragment,q),Se=!1},d(q){q&&(detach(e),detach(p),detach(b),detach(A),detach(R),detach(F),detach(V)),Te&&Te.d(),Oe&&Oe.d(),yt&&yt.d(),Tt&&Tt.d(),St&&St.d(),destroy_component(J),De=!1,run_all(Be)}}}function create_button_slot$6(o){let e,n,r,c,u;return n=new Icon({props:{icon:"filter"}}),{c(){e=element("div"),create_component(n.$$.fragment),r=space$3(),c=element("span"),c.textContent="Filter",attr(c,"class","ms-1"),attr(e,"slot","button")},m(h,p){insert$1(h,e,p),mount_component(n,e,null),append(e,r),append(e,c),u=!0},p:noop,i(h){u||(transition_in(n.$$.fragment,h),u=!0)},o(h){transition_out(n.$$.fragment,h),u=!1},d(h){h&&detach(e),destroy_component(n)}}}function create_fragment$10(o){let e,n,r,c={$$slots:{button:[create_button_slot$6],default:[create_default_slot$7]},$$scope:{ctx:o}};return n=new Dropdown({props:c}),o[34](n),{c(){e=element("div"),create_component(n.$$.fragment)},m(u,h){insert$1(u,e,h),mount_component(n,e,null),r=!0},p(u,h){const p={};h[0]&254|h[1]&32768&&(p.$$scope={dirty:h,ctx:u}),n.$set(p)},i(u){r||(transition_in(n.$$.fragment,u),r=!0)},o(u){transition_out(n.$$.fragment,u),r=!1},d(u){u&&detach(e),o[34](null),destroy_component(n)}}}function instance$10(o,e,n){const r=createEventDispatcher();let{schema:c}=e,{systemFields:u=[]}=e,{operators:h}=e,{inModal:p}=e,{modalUrl:b}=e,y,k="",A=u;c.type==="collection"&&(A=u.filter(rn=>rn.fi
2024-08-22 17:59:06 +03:00
Upload file
`),u=element("input"),attr(r,"class","spinner-border spinner-border-sm"),attr(r,"role","status"),attr(r,"aria-hidden","true"),attr(u,"class","form-control"),attr(u,"type","file"),attr(u,"id","formFile"),u.multiple=!0,attr(u,"accept",mimeTypes),u.disabled=o[0],u.hidden=!0,attr(n,"class","button primary btn-spinner "),attr(e,"class","upload-button"),e.disabled=o[0]},m(b,y){insert$1(b,e,y),append(e,n),append(n,r),append(n,c),append(n,u),h||(p=listen(u,"input",o[1]),h=!0)},p(b,[y]){y&1&&(u.disabled=b[0]),y&1&&(e.disabled=b[0])},i:noop,o:noop,d(b){b&&detach(e),h=!1,p()}}}let mimeTypes="";function instance$$(o,e,n){const r=createEventDispatcher(),c=getContext$1("channel");let{schema:u}=e,h=[],p=!1;function b(y){n(0,p=!0),h=y.target.files?[...y.target.files]:[];let k=new FormData;k.append("schema",u.name),Array.from(h).forEach(function(A){k.append("files[]",A)}),r("beforeUpload",h),axios.post(c.lucentUrl+"/files/upload",k,{headers:{"Content-Type":"multipart/form-data"}}).then(A=>{A.data.error?r("uploadError",A.data.error):r("uploadComplete",A.data),n(0,p=!1)}).catch(A=>{n(0,p=!1),console.log(A.response.data)})}return o.$$set=y=>{"schema"in y&&n(2,u=y.schema)},[p,b,u]}class Uploader extends SvelteComponent{constructor(e){super(),init(this,e,instance$$,create_fragment$$,safe_not_equal,{schema:2})}}function get_each_context$i(o,e,n){const r=o.slice();return r[18]=e[n],r}function get_each_context_1$5(o,e,n){const r=o.slice();return r[18]=e[n],r}function create_each_block_1$5(o){let e,n,r,c,u,h,p,b,y,k,A=o[18].label+"",R,N,F,V;r=new Icon({props:{icon:"arrow-up-short-wide"}});function W(...j){return o[10](o[18],...j)}p=new Icon({props:{icon:"arrow-down-wide-short"}});function J(...j){return o[11](o[18],...j)}function te(...j){return o[12](o[18],...j)}return{c(){e=element("div"),n=element("button"),create_component(r.$$.fragment),u=space$3(),h=element("button"),create_component(p.$$.fragment),y=space$3(),k=element("button"),R=text(A),attr(n,"title","Sort Ascending"),attr(n,"class",c="button button-icon "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"active":"")),attr(h,"title","Sort Descending"),attr(h,"class",b="button button-icon "+(o[18].name==o[1].name&&o[0].startsWith("-")?"active":"")),attr(k,"title","Sort Ascending"),attr(k,"class","button"),attr(e,"class","dropdown-item")},m(j,ae){insert$1(j,e,ae),append(e,n),mount_component(r,n,null),append(e,u),append(e,h),mount_component(p,h,null),append(e,y),append(e,k),append(k,R),N=!0,F||(V=[listen(n,"click",W),listen(h,"click",J),listen(k,"click",te)],F=!0)},p(j,ae){o=j,(!N||ae&11&&c!==(c="button button-icon "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"active":"")))&&attr(n,"class",c),(!N||ae&11&&b!==(b="button button-icon "+(o[18].name==o[1].name&&o[0].startsWith("-")?"active":"")))&&attr(h,"class",b),(!N||ae&8)&&A!==(A=o[18].label+"")&&set_data(R,A)},i(j){N||(transition_in(r.$$.fragment,j),transition_in(p.$$.fragment,j),N=!0)},o(j){transition_out(r.$$.fragment,j),transition_out(p.$$.fragment,j),N=!1},d(j){j&&detach(e),destroy_component(r),destroy_component(p),F=!1,run_all(V)}}}function create_each_block$i(o){let e,n,r,c,u,h,p,b,y,k,A=o[18].label+"",R,N,F,V,W;r=new Icon({props:{icon:"arrow-up-short-wide"}});function J(...ae){return o[13](o[18],...ae)}p=new Icon({props:{icon:"arrow-down-wide-short"}});function te(...ae){return o[14](o[18],...ae)}function j(...ae){return o[15](o[18],...ae)}return{c(){e=element("div"),n=element("button"),create_component(r.$$.fragment),u=space$3(),h=element("button"),create_component(p.$$.fragment),y=space$3(),k=element("button"),R=text(A),N=space$3(),attr(n,"title","Sort Ascending"),attr(n,"class",c="button button-icon "+(o[18].name==o[0]?"active":"")),attr(h,"title","Sort Descending"),attr(h,"class",b="button button-icon "+("-"+o[18].name==o[0]?"active":"")),attr(k,"title","Sort Ascending"),attr(k,"class","button"),attr(e,"class","dropdown-item")},m(ae,fe){insert$1(ae,e,fe),append(e,n),mount_component(r,n,null),append(e,u),append(e,h),mount_component(p,h,null),append(e,y),append(e,k),append(k,R),append(e,N),F=!0,V||(W=[listen(n,"click",J),
2024-08-23 18:15:18 +03:00
`),r=element("button"),create_component(c.$$.fragment),attr(r,"type","button"),attr(r,"class","button-text"),attr(r,"aria-label","Close"),attr(e,"class","applied-filter")},m(b,y){insert$1(b,e,y),append(e,n),append(e,r),mount_component(c,r,null),u=!0,h||(p=listen(r,"click",prevent_default(o[4])),h=!0)},p:noop,i(b){u||(transition_in(c.$$.fragment,b),u=!0)},o(b){transition_out(c.$$.fragment,b),u=!1},d(b){b&&detach(e),destroy_component(c),h=!1,p()}}}function create_fragment$Y(o){let e=o[0].searchParams.get("notlinked"),n,r,c=e&&create_if_block$D(o);return{c(){c&&c.c(),n=empty$1()},m(u,h){c&&c.m(u,h),insert$1(u,n,h),r=!0},p(u,[h]){e&&c.p(u,h)},i(u){r||(transition_in(c),r=!0)},o(u){transition_out(c),r=!1},d(u){u&&detach(n),c&&c.d(u)}}}function instance$Y(o,e,n){getContext$1("channel");const r=createEventDispatcher();let{inModal:c}=e,{modalUrl:u}=e;const h=new URL(u??window.location.href);function p(y){const k=new URL(u??window.location.href);k.searchParams.set("skip","0"),k.searchParams.delete("notlinked"),c?r("refresh",k):window.location.replace(k)}const b=()=>p();return o.$$set=y=>{"inModal"in y&&n(2,c=y.inModal),"modalUrl"in y&&n(3,u=y.modalUrl)},[h,p,c,u,b]}class AppliedFilterNotLinked extends SvelteComponent{constructor(e){super(),init(this,e,instance$Y,create_fragment$Y,safe_not_equal,{inModal:2,modalUrl:3})}}function get_each_context$h(o,e,n){const r=o.slice();return r[22]=e[n][0],r[23]=e[n][1],r}function create_else_block_1$2(o){let e,n,r;return n=new Uploader({props:{schema:o[0]}}),n.$on("uploadComplete",o[13]),{c(){e=element("div"),create_component(n.$$.fragment)},m(c,u){insert$1(c,e,u),mount_component(n,e,null),r=!0},p(c,u){const h={};u&1&&(h.schema=c[0]),n.$set(h)},i(c){r||(transition_in(n.$$.fragment,c),r=!0)},o(c){transition_out(n.$$.fragment,c),r=!1},d(c){c&&detach(e),destroy_component(n)}}}function create_if_block_4$4(o){let e,n=!o[5]&&o[7]&&create_if_block_5$2(o);return{c(){n&&n.c(),e=empty$1()},m(r,c){n&&n.m(r,c),insert$1(r,e,c)},p(r,c){!r[5]&&r[7]?n?n.p(r,c):(n=create_if_block_5$2(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:noop,o:noop,d(r){r&&detach(e),n&&n.d(r)}}}function create_if_block_5$2(o){let e,n,r;return{c(){e=element("a"),n=text("New Record"),attr(e,"href",r=o[10].lucentUrl+"/records/new?schema="+o[0].name),attr(e,"class","button")},m(c,u){insert$1(c,e,u),append(e,n)},p(c,u){u&1&&r!==(r=c[10].lucentUrl+"/records/new?schema="+c[0].name)&&attr(e,"href",r)},d(c){c&&detach(e)}}}function create_if_block_1$l(o){let e,n;return e=new Dropdown({props:{orientation:"right",$$slots:{button:[create_button_slot$4],default:[create_default_slot$5]},$$scope:{ctx:o}}}),{c(){create_component(e.$$.fragment)},m(r,c){mount_component(e,r,c),n=!0},p(r,c){const u={};c&67109009&&(u.$$scope={dirty:c,ctx:r}),e.$set(u)},i(r){n||(transition_in(e.$$.fragment,r),n=!0)},o(r){transition_out(e.$$.fragment,r),n=!1},d(r){destroy_component(e,r)}}}function create_else_block$f(o){let e,n,r,c,u,h,p,b,y,k;return{c(){e=element("a"),n=text("Export to CSV"),r=space$3(),c=element("a"),u=text("View trashed records"),p=space$3(),b=element("a"),y=text("View unlinked records"),attr(e,"class","dropdown-item"),attr(e,"href",o[11]),attr(c,"class","dropdown-item"),attr(c,"href",h=o[10].lucentUrl+"/content/"+o[0].name+"?filter[status_in]=trashed"),attr(b,"class","dropdown-item"),attr(b,"href",k=o[10].lucentUrl+"/content/"+o[0].name+"?notlinked=*")},m(A,R){insert$1(A,e,R),append(e,n),insert$1(A,r,R),insert$1(A,c,R),append(c,u),insert$1(A,p,R),insert$1(A,b,R),append(b,y)},p(A,R){R&1&&h!==(h=A[10].lucentUrl+"/content/"+A[0].name+"?filter[status_in]=trashed")&&attr(c,"href",h),R&1&&k!==(k=A[10].lucentUrl+"/content/"+A[0].name+"?notlinked=*")&&attr(b,"href",k)},d(A){A&&(detach(e),detach(r),detach(c),detach(p),detach(b))}}}function create_if_block_2$9(o){let e,n=o[7]&&create_if_block_3$7(o);return{c(){n&&n.c(),e=empty$1()},m(r,c){n&&n.m(r,c),insert$1(r,e,c)},p(r,c){r[7]?n?n.p(r,c):(n=create_if_block_3$7(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(r){r&&detach(e),n&&n.d(r)}}}function create_if_block_3$7(o){let e,n,r;return{c(){e=eleme
2024-08-22 17:59:06 +03:00
`),h=element("span"),b=text(p),y=text(`
to
`),k=element("span"),R=text(A),N=text(`
of
`),F=element("span"),V=text(o[4]),W=text(`
2024-08-23 18:15:18 +03:00
total`),attr(n,"class","pagination"),attr(h,"class","font-medium"),attr(k,"class","font-medium"),attr(F,"class","font-medium"),set_style(c,"display","flex"),set_style(c,"justify-content","center"),set_style(c,"gap","4px")},m(j,ae){insert$1(j,e,ae),append(e,n),te&&te.m(n,null),insert$1(j,r,ae),insert$1(j,c,ae),append(c,u),append(c,h),append(h,b),append(c,y),append(c,k),append(k,R),append(c,N),append(c,F),append(F,V),append(c,W),J=!0},p(j,[ae]){j[5]>1?te?(te.p(j,ae),ae&32&&transition_in(te,1)):(te=create_if_block$A(j),te.c(),transition_in(te,1),te.m(n,null)):te&&(group_outros(),transition_out(te,1,1,()=>{te=null}),check_outros()),(!J||ae&8)&&p!==(p=+j[3]+1+"")&&set_data(b,p),(!J||ae&28)&&A!==(A=(+j[3]+j[2]>j[4]?j[4]:+j[3]+j[2])+"")&&set_data(R,A),(!J||ae&16)&&set_data(V,j[4])},i(j){J||(transition_in(te),J=!0)},o(j){transition_out(te),J=!1},d(j){j&&(detach(e),detach(r),detach(c)),te&&te.d()}}}function instance$V(o,e,n){let r,c,u;const h=createEventDispatcher();let{inModal:p}=e,{modalUrl:b}=e,{limit:y}=e,{skip:k}=e,{total:A}=e;function R(W){W.preventDefault(),F(r)}function N(W){W.preventDefault(),F(1)}function F(W){const J=new URL(b??window.location.href);let te=W*y-y;J.searchParams.set("skip",te),p?h("refresh",J):window.location=J}function V(W){bubble.call(this,o,W)}return o.$$set=W=>{"inModal"in W&&n(0,p=W.inModal),"modalUrl"in W&&n(1,b=W.modalUrl),"limit"in W&&n(2,y=W.limit),"skip"in W&&n(3,k=W.skip),"total"in W&&n(4,A=W.total)},o.$$.update=()=>{o.$$.dirty&20&&n(5,r=Math.ceil(A/y)),o.$$.dirty&12&&n(6,c=Math.ceil((k-1)/y)+1),o.$$.dirty&96&&n(7,u=lodashExports.range(c-3,c+4).filter(W=>W>0&&W<=r))},[p,b,y,k,A,r,c,u,R,N,V]}class Pagination extends SvelteComponent{constructor(e){super(),init(this,e,instance$V,create_fragment$V,safe_not_equal,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function create_else_block$d(o){let e,n,r;return{c(){e=element("button"),e.textContent="Move to trash",attr(e,"type","button"),attr(e,"class","button")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",prevent_default(o[9])),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_if_block$z(o){let e,n,r,c,u,h,p=o[1].hasDrafts&&create_if_block_1$k(o);return{c(){e=element("button"),e.textContent="Publish",n=space$3(),p&&p.c(),r=space$3(),c=element("button"),c.textContent="Delete forever",attr(e,"type","button"),attr(e,"class","button"),attr(c,"type","button"),attr(c,"class","button")},m(b,y){insert$1(b,e,y),insert$1(b,n,y),p&&p.m(b,y),insert$1(b,r,y),insert$1(b,c,y),u||(h=[listen(e,"click",prevent_default(o[7])),listen(c,"click",prevent_default(o[3]))],u=!0)},p(b,y){b[1].hasDrafts?p?p.p(b,y):(p=create_if_block_1$k(b),p.c(),p.m(r.parentNode,r)):p&&(p.d(1),p=null)},d(b){b&&(detach(e),detach(n),detach(r),detach(c)),p&&p.d(b),u=!1,run_all(h)}}}function create_if_block_1$k(o){let e,n,r;return{c(){e=element("button"),e.textContent="Make Draft",attr(e,"type","button"),attr(e,"class","button")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",prevent_default(o[8])),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_fragment$U(o){let e,n,r=o[0].length+"",c,u,h,p,b,y,k,A,R;function N(W,J){return W[2].status_in==="trashed"?create_if_block$z:create_else_block$d}let F=N(o),V=F(o);return{c(){e=element("div"),n=element("span"),c=text(r),u=text(" records selected"),h=space$3(),p=element("button"),p.textContent="Publish",b=space$3(),y=element("button"),y.textContent="Make Draft",k=space$3(),V.c(),attr(n,"class","me-2"),attr(p,"type","button"),attr(p,"class","button"),attr(y,"type","button"),attr(y,"class","button"),set_style(e,"display","flex"),set_style(e,"align-items","center"),set_style(e,"gap","8px")},m(W,J){insert$1(W,e,J),append(e,n),append(n,c),append(n,u),append(e,h),append(e,p),append(e,b),append(e,y),append(e,k),V.m(e,null),A||(R=[listen(p,"click",prevent_default(o[5])),listen(y,"click",prevent_default(o[6]))],A=!0)},p(W,[J]){J&1&&r!==(r=W[0].length+"")&&set_data(c,r),F===(F=N(W))&&V?V.p(W,J):(V.d(1),V=F(W),V&&(V.c(),V.m(e,null)))},i:noop,o:noop,d(W){W&&detach(e),V.d(),A=!1,run_all(R)}}}function instance$U(o,e,n){const r=getContext$1("channe
2024-08-23 19:37:20 +03:00
Search`),h=space$3(),attr(e,"class","button"),attr(r,"class","button")},m(R,N){insert$1(R,e,N),insert$1(R,n,N),insert$1(R,r,N),mount_component(c,r,null),append(r,u),insert$1(R,h,N),p=!0,b||(y=[listen(e,"click",k),listen(r,"click",A)],b=!0)},p(R,N){o=R},i(R){p||(transition_in(c.$$.fragment,R),p=!0)},o(R){transition_out(c.$$.fragment,R),p=!1},d(R){R&&(detach(e),detach(n),detach(r),detach(h)),destroy_component(c),b=!1,run_all(y)}}}function create_button_slot$3(o){let e,n=o[18].label+"",r,c;return{c(){e=element("div"),r=text(n),c=space$3(),attr(e,"slot","button"),toggle_class(e,"is-first",!o[1])},m(u,h){insert$1(u,e,h),append(e,r),append(e,c)},p(u,h){h&1&&n!==(n=u[18].label+"")&&set_data(r,n),h&2&&toggle_class(e,"is-first",!u[1])},d(u){u&&detach(e)}}}function create_each_block$b(o){let e,n;return e=new Dropdown({props:{$$slots:{button:[create_button_slot$3],default:[create_default_slot_1$1]},$$scope:{ctx:o}}}),{c(){create_component(e.$$.fragment)},m(r,c){mount_component(e,r,c),n=!0},p(r,c){const u={};c&2097155&&(u.$$scope={dirty:c,ctx:r}),e.$set(u)},i(r){n||(transition_in(e.$$.fragment,r),n=!0)},o(r){transition_out(e.$$.fragment,r),n=!1},d(r){destroy_component(e,r)}}}function create_if_block$s(o){let e,n;const r=[o[4],{isCreateMode:!0}];let c={};for(let u=0;u<r.length;u+=1)c=assign(c,r[u]);return e=new InlineEdit({props:c}),e.$on("cancel",o[13]),e.$on("inlinesaved",o[6]),{c(){create_component(e.$$.fragment)},m(u,h){mount_component(e,u,h),n=!0},p(u,h){const p=h&16?get_spread_update(r,[get_spread_object(u[4]),r[1]]):{};e.$set(p)},i(u){n||(transition_in(e.$$.fragment,u),n=!0)},o(u){transition_out(e.$$.fragment,u),n=!1},d(u){destroy_component(e,u)}}}function create_default_slot$4(o){let e,n,r=o[4]&&create_if_block$s(o);return{c(){r&&r.c(),e=empty$1()},m(c,u){r&&r.m(c,u),insert$1(c,e,u),n=!0},p(c,u){c[4]?r?(r.p(c,u),u&16&&transition_in(r,1)):(r=create_if_block$s(c),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(c){n||(transition_in(r),n=!0)},o(c){transition_out(r),n=!1},d(c){c&&detach(e),r&&r.d(c)}}}function create_fragment$z(o){let e,n,r,c,u,h,p;const b=[create_if_block_1$g,create_else_block$a],y=[];function k(N,F){return N[0].length>1?0:1}e=k(o),n=y[e]=b[e](o);let A={$$slots:{default:[create_default_slot$4]},$$scope:{ctx:o}};c=new DialogRecord({props:A}),o[14](c);let R={};return h=new Dialog({props:R}),o[15](h),h.$on("insert",o[7]),{c(){n.c(),r=space$3(),create_component(c.$$.fragment),u=space$3(),create_component(h.$$.fragment)},m(N,F){y[e].m(N,F),insert$1(N,r,F),mount_component(c,N,F),insert$1(N,u,F),mount_component(h,N,F),p=!0},p(N,[F]){let V=e;e=k(N),e===V?y[e].p(N,F):(group_outros(),transition_out(y[V],1,1,()=>{y[V]=null}),check_outros(),n=y[e],n?n.p(N,F):(n=y[e]=b[e](N),n.c()),transition_in(n,1),n.m(r.parentNode,r));const W={};F&2097168&&(W.$$scope={dirty:F,ctx:N}),c.$set(W);const J={};h.$set(J)},i(N){p||(transition_in(n),transition_in(c.$$.fragment,N),transition_in(h.$$.fragment,N),p=!0)},o(N){transition_out(n),transition_out(c.$$.fragment,N),transition_out(h.$$.fragment,N),p=!1},d(N){N&&(detach(r),detach(u)),y[e].d(N),o[14](null),destroy_component(c,N),o[15](null),destroy_component(h,N)}}}function instance$z(o,e,n){const r=createEventDispatcher(),c=getContext$1("channel");let{schemas:u}=e,{recordId:h}=e,p,b,y;function k(fe,_e){fe.preventDefault(),p.open(_e)}function A(fe){fe.preventDefault(),console.log("Save inline"),n(4,y=null),b.close(),r("save",{records:fe.detail.records,after:h})}function R(fe){fe.preventDefault(),p.close(),r("insert",{records:fe.detail.records,schema:fe.detail.schema,after:h})}function N(fe,_e){fe.preventDefault(),axios$1.get(c.lucentUrl+"/records/newInline?schema="+_e).then(ne=>{n(4,y=ne.data),b.open()}).catch(ne=>{console.log(ne)})}const F=(fe,_e)=>N(_e,fe.name),V=(fe,_e)=>k(_e,fe.name),W=fe=>N(fe,u[0].name),J=fe=>k(fe,u[0].name),te=fe=>n(4,y=null);function j(fe){binding_callbacks[fe?"unshift":"push"](()=>{b=fe,n(3,b)})}function ae(fe){binding_callbacks[fe?"unshift":"push"](()=>{p=fe,n(2,p)})}return o.$$
2024-08-22 17:59:06 +03:00
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
2024-08-23 18:15:18 +03:00
*/function ownKeys(o,e){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(c){return Object.getOwnPropertyDescriptor(o,c).enumerable})),n.push.apply(n,r)}return n}function _objectSpread2(o){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(r){_defineProperty(o,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(n,r))})}return o}function _typeof(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(e){return typeof e}:_typeof=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(o)}function _defineProperty(o,e,n){return e in o?Object.defineProperty(o,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[e]=n,o}function _extends(){return _extends=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[r]=n[r])}return o},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(o,e){if(o==null)return{};var n={},r=Object.keys(o),c,u;for(u=0;u<r.length;u++)c=r[u],!(e.indexOf(c)>=0)&&(n[c]=o[c]);return n}function _objectWithoutProperties(o,e){if(o==null)return{};var n=_objectWithoutPropertiesLoose(o,e),r,c;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);for(c=0;c<u.length;c++)r=u[c],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(o,r)&&(n[r]=o[r])}return n}var version="1.15.2";function userAgent(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on(o,e,n){o.addEventListener(e,n,!IE11OrLess&&captureMode)}function off(o,e,n){o.removeEventListener(e,n,!IE11OrLess&&captureMode)}function matches(o,e){if(e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function getParentOrHost(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function closest(o,e,n,r){if(o){n=n||document;do{if(e!=null&&(e[0]===">"?o.parentNode===n&&matches(o,e):matches(o,e))||r&&o===n)return o;if(o===n)break}while(o=getParentOrHost(o))}return null}var R_SPACE=/\s+/g;function toggleClass$1(o,e,n){if(o&&e)if(o.classList)o.classList[n?"add":"remove"](e);else{var r=(" "+o.className+" ").replace(R_SPACE," ").replace(" "+e+" "," ");o.className=(r+(n?" "+e:"")).replace(R_SPACE," ")}}function css$1(o,e,n){var r=o&&o.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(n=o.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function matrix(o,e){var n="";if(typeof o=="string")n=o;else do{var r=css$1(o,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(o=o.parentNode));var c=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return c&&new c(n)}function find$1(o,e,n){if(o){var r=o.getElementsByTagName(e),c=0,u=r.length;if(n)for(;c<u;c++)n(r[c],c);return r}return[]}function getWindowScrollingElement(){var o=document.scrollingElement;return o||document.documentElement}function getRect(o,e,n,r,c){if(!(!o.getBoundingClientRect&&o!==window)){var u,h,p,b,y,k,A;if(o!==window&&o.parentNode&&o!==getWindowScrollingElement()?(u=o.getBoundingClientRect(),h=u.top,p=u.left,b=u.bottom,y=u.right,k=u.h
2024-08-22 17:59:06 +03:00
<span class='flatpickr-weekday'>
`+Ye.join("</span><span class='flatpickr-weekday'>")+`
</span>
2024-08-23 18:15:18 +03:00
`}}function Rt(){n.calendarContainer.classList.add("hasWeeks");var Qe=createElement("div","flatpickr-weekwrapper");Qe.appendChild(createElement("span","flatpickr-weekday",n.l10n.weekAbbreviation));var Ye=createElement("div","flatpickr-weeks");return Qe.appendChild(Ye),{weekWrapper:Qe,weekNumbers:Ye}}function Ue(Qe,Ye){Ye===void 0&&(Ye=!0);var wt=Ye?Qe:Qe-n.currentMonth;wt<0&&n._hidePrevMonthArrow===!0||wt>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=wt,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,wo("onYearChange"),yt()),Oe(),wo("onMonthChange"),ts())}function ct(Qe,Ye){if(Qe===void 0&&(Qe=!0),Ye===void 0&&(Ye=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,Ye===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var wt=getDefaultHours(n.config),Ft=wt.hours,Rn=wt.minutes,Xn=wt.seconds;N(Ft,Rn,Xn)}n.redraw(),Qe&&wo("onChange")}function dn(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),wo("onClose")}function Zt(){n.config!==void 0&&wo("onDestroy");for(var Qe=n._handlers.length;Qe--;)n._handlers[Qe].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var Ye=n.calendarContainer.parentNode;if(Ye.lastChild&&Ye.removeChild(Ye.lastChild),Ye.parentNode){for(;Ye.firstChild;)Ye.parentNode.insertBefore(Ye.firstChild,Ye);Ye.parentNode.removeChild(Ye)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(wt){try{delete n[wt]}catch{}})}function rn(Qe){return n.calendarContainer.contains(Qe)}function Fe(Qe){if(n.isOpen&&!n.config.inline){var Ye=getEventTarget(Qe),wt=rn(Ye),Ft=Ye===n.input||Ye===n.altInput||n.element.contains(Ye)||Qe.path&&Qe.path.indexOf&&(~Qe.path.indexOf(n.input)||~Qe.path.indexOf(n.altInput)),Rn=!Ft&&!wt&&!rn(Qe.relatedTarget),Xn=!n.config.ignoredFocusElements.some(function(ro){return ro.contains(Ye)});Rn&&Xn&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0&&n.input.value!==""&&n.input.value!==void 0&&b(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function mt(Qe){if(!(!Qe||n.config.minDate&&Qe<n.config.minDate.getFullYear()||n.config.maxDate&&Qe>n.config.maxDate.getFullYear())){var Ye=Qe,wt=n.currentYear!==Ye;n.currentYear=Ye||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),wt&&(n.redraw(),wo("onYearChange"),yt())}}function de(Qe,Ye){var wt;Ye===void 0&&(Ye=!0);var Ft=n.parseDate(Qe,void 0,Ye);if(n.config.minDate&&Ft&&compareDates(Ft,n.config.minDate,Ye!==void 0?Ye:!n.minDateHasTime)<0||n.
`||s==="\r",NO=(s,l)=>l<s.length&&l>=0?lf(s[l]):!1,mh=(s,l=4,d=!0,m=!0)=>{const v=ka(" ",l),w=s.replace(/\t/g,v);return Dn(w,(B,H)=>ep(H)||H===Fs?B.pcIsSpace||B.str===""&&d||B.str.length===w.length-1&&m||NO(w,B.str.length+1)?{pcIsSpace:!1,str:B.str+Fs}:{pcIsSpace:!0,str:B.str+" "}:{pcIsSpace:lf(H),str:B.str+H},{pcIsSpace:!1,str:""}).str},d1=(s,l)=>{const d=qe.fromDom(l),m=qe.fromDom(s);return F0(m,"pre,code",Ue(dt,d))},ph=(s,l)=>un(s)&&hh(s.data)&&!d1(s,l),ta=s=>Zn(s)&&s.nodeName==="A"&&!s.hasAttribute("href")&&(s.hasAttribute("name")||s.hasAttribute("id")),Xu=(s,l)=>_s(s)&&!ph(s,l)||ta(s)||xd(s),xd=Ym("data-mce-bookmark"),gh=Ym("data-mce-bogus"),bh=Ta("data-mce-bogus","all"),tp=s=>br(qe.fromDom(s)).exists(l=>!Zo(l)),au=(s,l)=>{let d=0;if(Xu(s,s))return!1;{let m=s.firstChild;if(!m)return!0;const v=new Hr(m,s);do{if(l){if(bh(m)){m=v.next(!0);continue}if(gh(m)){m=v.next();continue}}if(wl(m)&&tp(m))return!1;if(Js(m)){d++,m=v.next();continue}if(Xu(m,s))return!1;m=v.next()}while(m);return d<=1}},Fi=(s,l=!0)=>au(s.dom,l),Ed=s=>s.toLowerCase()==="svg",ib=s=>Ed(s.nodeName),f1=s=>(s==null?void 0:s.nodeName)==="svg"?"svg":"html",h1=["svg"],vh=()=>{let s=[];const l=()=>s[s.length-1];return{track:w=>{ib(w)&&s.push(w);let $=l();return $&&!$.contains(w)&&(s.pop(),$=l()),f1($)},current:()=>f1(l()),reset:()=>{s=[]}}},ec="data-mce-block",ju=s=>xt(ts(s),l=>!/[A-Z]/.test(l)),$f=s=>pt(ju(s),l=>`${l}:`+pt(h1,d=>`not(${d} ${l})`).join(":")).join(","),cf=(s,l)=>Te(l.querySelector(s))?(l.setAttribute(ec,"true"),l.getAttribute("data-mce-selected")==="inline-boundary"&&l.removeAttribute("data-mce-selected"),!0):(l.removeAttribute(ec),!1),bc=(s,l)=>{const d=$f(s.getTransparentElements()),m=$f(s.getBlockElements());return xt(l.querySelectorAll(d),v=>cf(m,v))},Yu=(s,l)=>{var d;const m=l?"lastChild":"firstChild";for(let v=s[m];v;v=v[m])if(Fi(qe.fromDom(v))){(d=v.parentNode)===null||d===void 0||d.removeChild(v);return}},Oh=(s,l)=>{const d=document.createRange(),m=s.parentNode;if(m){d.setStartBefore(s),d.setEndBefore(l);const v=d.extractContents();Yu(v,!0),d.setStartAfter(l),d.setEndAfter(s);const w=d.extractContents();Yu(w,!1),Fi(qe.fromDom(v))||m.insertBefore(v,s),Fi(qe.fromDom(l))||m.insertBefore(l,s),Fi(qe.fromDom(w))||m.insertBefore(w,s),m.removeChild(s)}},H0=(s,l,d)=>{const m=s.getBlockElements(),v=qe.fromDom(l),w=B=>Os(B)in m,$=B=>dt(B,v);Ne(wu(d),B=>{Rr(B,w,$).each(H=>{const G=Yl(B,le=>w(le)&&!s.isValidChild(Os(H),Os(le)));if(G.length>0){const le=br(H);Ne(G,ue=>{Rr(ue,w,$).each(ge=>{Oh(ge.dom,ue.dom)})}),le.each(ue=>bc(s,ue.dom))}})})},ab=(s,l,d)=>{Ne([...d,...gs(s,l)?[l]:[]],m=>Ne(Fa(qe.fromDom(m),m.nodeName.toLowerCase()),v=>{ho(s,v.dom)&&La(v)}))},Kp=(s,l)=>{const d=bc(s,l);H0(s,l,d),ab(s,l,d)},yh=(s,l)=>{if(tg(s,l)){const d=$f(s.getBlockElements());cf(d,l)}},Jp=(s,l,d)=>{const m=w=>dt(w,qe.fromDom(l)),v=rh(qe.fromDom(d),m);dr(v,v.length-2).filter(Ra).fold(()=>Kp(s,l),w=>Kp(s,w.dom))},lb=s=>s.hasAttribute(ec),eg=(s,l)=>an(s.getTransparentElements(),l),tg=(s,l)=>Zn(l)&&eg(s,l.nodeName),gs=(s,l)=>tg(s,l)&&lb(l),ho=(s,l)=>tg(s,l)&&!lb(l),Td=(s,l)=>l.type===1&&eg(s,l.name)&&j(l.attr(ec)),ng=Ko().browser,cm=s=>Gn(s,Ra),tw=s=>ng.isFirefox()&&Os(s)==="table"?cm(Ci(s)).filter(l=>Os(l)==="caption").bind(l=>cm(la(l)).map(d=>{const m=d.dom.offsetTop,v=l.dom.offsetTop,w=l.dom.offsetHeight;return m<=v?-w:0})).getOr(0):0,cb=(s,l)=>s.children&&gt(s.children,l),kr=(s,l,d)=>{let m=0,v=0;const w=s.ownerDocument;if(d=d||s,l){if(d===s&&l.getBoundingClientRect&&ki(qe.fromDom(s),"position")==="static"){const B=l.getBoundingClientRect();return m=B.left+(w.documentElement.scrollLeft||s.scrollLeft)-w.documentElement.clientLeft,v=B.top+(w.documentElement.scrollTop||s.scrollTop)-w.documentElement.clientTop,{x:m,y:v}}let $=l;for(;$&&$!==d&&$.nodeType&&!cb($,d);){const B=$;m+=B.offsetLeft||0,v+=B.offsetTop||0,$=B.offsetParent}for($=l.parentNode;$&&$!==d&&$.nodeType&&!cb($,d);)m-=$.scrollLeft||0,v-=$.scrollTop||0,$=$.parentNode;v+=tw(qe.fromDom(l))}return{x:m,y:v}},ub=(s,l={})=>{let d=0;const m={},v=qe.fromDom(s),w=uo(v),$=rt=>{l.referrerPolicy=rt},B=rt=>{l.contentCssCo
2024-08-22 17:59:06 +03:00
Actual: `+ge.join(","));if(!Vs(l,He=>gt(ge,He)))throw new Error("Not all branches were specified when using match. Specified: "+ge.join(", ")+`
2024-08-23 18:15:18 +03:00
Required: `+l.join(", "));return ue[$].apply(null,H)},log:ue=>{console.log(ue,{constructors:l,constructor:$,params:H})}}}}),d}};hf.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const On=s=>{const l=[],d=[];return Ne(s,m=>{m.fold(v=>{l.push(v)},v=>{d.push(v)})}),{errors:l,values:d}},cv=s=>s.type==="inline-command"||s.type==="inline-format",Za=s=>s.type==="block-command"||s.type==="block-format",uv=s=>{const l=m=>zc.error({message:m,pattern:s}),d=(m,v,w)=>{if(s.format!==void 0){let $;if(_e(s.format)){if(!Vs(s.format,j))return l(m+" pattern has non-string items in the `format` array");$=s.format}else if(j(s.format))$=[s.format];else return l(m+" pattern has non-string `format` parameter");return zc.value(v($))}else return s.cmd!==void 0?j(s.cmd)?zc.value(w(s.cmd,s.value)):l(m+" pattern has non-string `cmd` parameter"):l(m+" pattern is missing both `format` and `cmd` parameters")};if(!ae(s))return l("Raw pattern is not an object");if(!j(s.start))return l("Raw pattern is missing `start` parameter");if(s.end!==void 0){if(!j(s.end))return l("Inline pattern has non-string `end` parameter");if(s.start.length===0&&s.end.length===0)return l("Inline pattern has empty `start` and `end` parameters");let m=s.start,v=s.end;return v.length===0&&(v=m,m=""),d("Inline",w=>({type:"inline-format",start:m,end:v,format:w}),(w,$)=>({type:"inline-command",start:m,end:v,cmd:w,value:$}))}else return s.replacement!==void 0?j(s.replacement)?s.start.length===0?l("Replacement pattern has empty `start` parameter"):zc.value({type:"inline-command",start:"",end:s.start,cmd:"mceInsertContent",value:s.replacement}):l("Replacement pattern has non-string `replacement` parameter"):s.start.length===0?l("Block pattern has empty `start` parameter"):d("Block",m=>({type:"block-format",start:s.start,format:m[0]}),(m,v)=>({type:"block-command",start:s.start,cmd:m,value:v}))},vm=s=>xt(s,Za),x1=s=>xt(s,cv),Wc=(s,l)=>({inlinePatterns:x1(s),blockPatterns:vm(s),dynamicPatternsLookup:l}),ty=s=>{const l=On(pt(s,uv));return Ne(l.errors,d=>console.error(d.message,d.pattern)),l.values},E1=s=>l=>{const d=s(l);return ty(d)},ji=Ko().deviceType,mf=ji.isTouch(),T1=Jr.DOM,Ff=s=>{const l=s.indexOf("=")>0?s.split(/[;,](?![^=;,]*(?:[;,]|$))/):s.split(",");return Dn(l,(d,m)=>{const v=m.split("="),w=v[0],$=v.length>1?v[1]:w;return d[Pl(w)]=Pl($),d},{})},Id=s=>te(s,RegExp),Hn=s=>l=>l.options.get(s),$u=s=>j(s)||ae(s),dv=(s,l="")=>d=>{const m=j(d);if(m)if(d.indexOf("=")!==-1){const v=Ff(d);return{value:ro(v,s.id).getOr(l),valid:m}}else return{value:d,valid:m};else return{valid:!1,message:"Must be a string."}},Hf=s=>{const l=s.options.register;l("id",{processor:"string",default:s.id}),l("selector",{processor:"string"}),l("target",{processor:"object"}),l("suffix",{processor:"string"}),l("cache_suffix",{processor:"string"}),l("base_url",{processor:"string"}),l("referrer_policy",{processor:"string",default:""}),l("language_load",{processor:"boolean",default:!0}),l("inline",{processor:"boolean",default:!1}),l("iframe_attrs",{processor:"object",default:{}}),l("doctype",{processor:"string",default:"<!DOCTYPE html>"}),l("document_base_url",{processor:"string",default:s.documentBaseUrl}),l("body_id",{processor:dv(s,"tinymce"),default:"tinymce"}),l("body_class",{processor:dv(s),default:""}),l("content_security_policy",{processor:"string",default:""}),l("br_in_pre",{processor:"boolean",default:!0}),l("forced_root_block",{processor:d=>{const m=j(d)&&Ls(d);return m?{value:d,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),l("forced_root_block_attrs",{processor:"object",default:{}}),l("newline_behavior",{processor:d=>{const m=gt(["block","linebreak","invert","default"],d);return m?{value:d,valid:m}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),l("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),l("no_newline_selector",{processor:"string",default:""}),l("keep_styles",{processor:"boolean",default:!0}),l
\r \v`.indexOf(s)!==-1,Bg=s=>!Kb(s)&&!$y(s)&&!Li(s),Py=s=>{const l=[];if(s)for(let d=0;d<s.rangeCount;d++)l.push(s.getRangeAt(d));return l},Dy=s=>Ns(s,l=>{const d=_g(l);return d?[qe.fromDom(d)]:[]}),L1=s=>Py(s).length>1,UE=s=>xt(Dy(s),Kl),mC=s=>Fa(s,"td[data-mce-selected],th[data-mce-selected]"),qE=(s,l)=>{const d=mC(l);return d.length>0?d:UE(s)},Jb=s=>qE(Py(s.selection.getSel()),qe.fromDom(s.getBody())),yp=(s,l)=>Dc(s,"table",l),XE=s=>{const l=s.startContainer,d=s.startOffset;return un(l)?d===0?de.some(qe.fromDom(l)):de.none():de.from(l.childNodes[d]).map(qe.fromDom)},jE=s=>{const l=s.endContainer,d=s.endOffset;return un(l)?d===l.data.length?de.some(qe.fromDom(l)):de.none():de.from(l.childNodes[d-1]).map(qe.fromDom)},pC=s=>Dr(s).fold(je([s]),l=>[s].concat(pC(l))),Gw=s=>Pc(s).fold(je([s]),l=>Os(l)==="br"?Ui(l).map(d=>[s].concat(Gw(d))).getOr([]):[s].concat(Gw(l))),Kw=(s,l)=>yr(XE(l),jE(l),(d,m)=>{const v=Gn(pC(s),Ue(dt,d)),w=Gn(Gw(s),Ue(dt,m));return v.isSome()&&w.isSome()}).getOr(!1),Jw=(s,l,d,m)=>{const v=d,w=new Hr(d,v),$=Ft(s.schema.getMoveCaretBeforeOnEnterElements(),(H,G)=>!gt(["td","th","table"],G.toLowerCase()));let B=d;do{if(un(B)&&cn.trim(B.data).length!==0){m?l.setStart(B,0):l.setEnd(B,B.data.length);return}if($[B.nodeName]){m?l.setStartBefore(B):B.nodeName==="BR"?l.setEndBefore(B):l.setEndAfter(B);return}}while(B=m?w.next():w.prev());v.nodeName==="BODY"&&(m?l.setStart(v,0):l.setEnd(v,v.childNodes.length))},Ry=s=>{const l=s.selection.getSel();return Te(l)&&l.rangeCount>0},Lg=(s,l)=>{const d=Jb(s);d.length>0?Ne(d,m=>{const v=m.dom,w=s.dom.createRng();w.setStartBefore(v),w.setEndAfter(v),l(w,!0)}):l(s.selection.getRng(),!1)},gC=(s,l,d)=>{const m=Lf(s,l);d(m),s.moveToBookmark(m)},Bv=s=>yt(s==null?void 0:s.nodeType),eS=s=>Zn(s)&&!Ld(s)&&!Bd(s)&&!Su(s),YE=(s,l)=>{if(eS(l)&&!/^(TD|TH)$/.test(l.nodeName)){const d=s.getAttrib(l,"data-mce-selected"),m=parseInt(d,10);return!isNaN(m)&&m>0}else return!1},Lv=(s,l,d)=>{const{selection:m,dom:v}=s,w=m.getNode(),$=ys(w);gC(m,!0,()=>{l()}),$&&ys(w)&&v.isChildOf(w,s.getBody())?s.selection.select(w):d(m.getStart())&&GE(v,m)},GE=(s,l)=>{var d,m;const v=l.getRng(),{startContainer:w,startOffset:$}=v,B=l.getNode();if(!YE(s,B)&&Zn(w)){const H=w.childNodes,G=s.getRoot();let le;if($<H.length){const ue=H[$];le=new Hr(ue,(d=s.getParent(ue,s.isBlock))!==null&&d!==void 0?d:G)}else{const ue=H[H.length-1];le=new Hr(ue,(m=s.getParent(ue,s.isBlock))!==null&&m!==void 0?m:G),le.next(!0)}for(let ue=le.current();ue;ue=le.next()){if(s.getContentEditable(ue)==="false")return;if(un(ue)&&!$a(ue)){v.setStart(ue,0),l.setRng(v);return}}}},Ln=(s,l,d)=>{if(s){const m=l?"nextSibling":"previousSibling";for(s=s[m];s;s=s[m])if(Zn(s)||!$a(s))return s}},il=(s,l)=>!!s.getTextBlockElements()[l.nodeName.toLowerCase()]||gs(s,l),_p=(s,l,d)=>s.schema.isValidChild(l,d),$a=(s,l=!1)=>{if(Te(s)&&un(s)){const d=l?s.data.replace(/ /g," "):s.data;return hh(d)}else return!1},gf=s=>Te(s)&&un(s)&&s.length===0,My=(s,l)=>{const d="[data-mce-cef-wrappable]",m=pf(s),v=Ji(m)?d:`${d},${m}`;return mc(qe.fromDom(l),v)},Fv=(s,l)=>{const d=s.dom;return eS(l)&&d.getContentEditable(l)==="false"&&My(s,l)&&d.select('[contenteditable="true"]',l).length===0},Lh=(s,l)=>Oe(s)?s(l):(Te(l)&&(s=s.replace(/%(\w+)/g,(d,m)=>l[m]||d)),s),Ny=(s,l)=>(s=s||"",l=l||"",s=""+(s.nodeName||s),l=""+(l.nodeName||l),s.toLowerCase()===l.toLowerCase()),Iy=(s,l)=>{if(Be(s))return null;{let d=String(s);return(l==="color"||l==="backgroundColor")&&(d=lu(d)),l==="fontWeight"&&s===700&&(d="bold"),l==="fontFamily"&&(d=d.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),d}},e0=(s,l,d)=>{const m=s.getStyle(l,d);return Iy(m,d)},bC=(s,l)=>{let d;return s.getParent(l,m=>Zn(m)?(d=s.getStyle(m,"text-decoration"),!!d&&d!=="none"):!1),d},Hv=(s,l,d)=>s.getParents(l,d,s.getRoot()),tS=(s,l,d)=>{const m=s.formatter.get(l);return Te(m)&&Ut(m,d)},nS=(s,l)=>tS(s,l,m=>{const v=w=>Oe(w)||w.length>1&&w.charAt(0)==="%";return Ut(["styles","attributes"],w=>ro(m,w).exists($=>{const B=_e($)?$:Xn($);return Ut(B,v)}))}),KE=(s,l,d)=>{const m=["inline","block","selector","attributes","styles","classes"]
2024-08-22 17:59:06 +03:00
]*|<br \\/>[\r
]*)$`);return l.replace(m,"")},dU=(s,l)=>{const d=s.getDoc(),m=pl(qe.fromDom(s.getBody())),v=qe.fromTag("div",d);Sr(v,"data-mce-bogus","all"),Ba(v,{position:"fixed",left:"-9999999px",top:"0"}),Nc(v,l.innerHTML),ss(v),ET(v);const w=l1(m);di(w,v);const $=ve(v.dom.innerText);return $s(v),$},w6=(s,l,d)=>{let m;return l.format==="raw"?m=cn.trim(ve(P4(d,s.serializer.getTempAttrs()).innerHTML)):l.format==="text"?m=dU(s,d):l.format==="tree"?m=s.serializer.serialize(d,l):m=uU(s,s.serializer.serialize(d,l)),l.format!=="text"&&!ya(qe.fromDom(d))&&j(m)?cn.trim(m):m},fU=(s,l)=>de.from(s.getBody()).fold(je(l.format==="tree"?new Iu("body",11):""),d=>w6(s,l,d)),S6=cn.makeMap,D4=s=>{const l=[];s=s||{};const d=s.indent,m=S6(s.indent_before||""),v=S6(s.indent_after||""),w=op.getEncodeFunc(s.entity_encoding||"raw",s.entities),$=s.element_format!=="xhtml";return{start:(B,H,G)=>{if(d&&m[B]&&l.length>0){const le=l[l.length-1];le.length>0&&le!==`
`&&l.push(`
`)}if(l.push("<",B),H)for(let le=0,ue=H.length;le<ue;le++){const ge=H[le];l.push(" ",ge.name,'="',w(ge.value,!0),'"')}if(!G||$?l[l.length]=">":l[l.length]=" />",G&&d&&v[B]&&l.length>0){const le=l[l.length-1];le.length>0&&le!==`
`&&l.push(`
`)}},end:B=>{let H;l.push("</",B,">"),d&&v[B]&&l.length>0&&(H=l[l.length-1],H.length>0&&H!==`
`&&l.push(`
`))},text:(B,H)=>{B.length>0&&(l[l.length]=H?B:w(B))},cdata:B=>{l.push("<![CDATA[",B,"]]>")},comment:B=>{l.push("<!--",B,"-->")},pi:(B,H)=>{H?l.push("<?",B," ",w(H),"?>"):l.push("<?",B,"?>"),d&&l.push(`
`)},doctype:B=>{l.push("<!DOCTYPE",B,">",d?`
2024-08-23 18:15:18 +03:00
`:"")},reset:()=>{l.length=0},getContent:()=>l.join("").replace(/\n$/,"")}},u0=(s={},l=Df())=>{const d=D4(s);return s.validate="validate"in s?s.validate:!0,{serialize:v=>{const w=s.validate,$={3:H=>{var G;d.text((G=H.value)!==null&&G!==void 0?G:"",H.raw)},8:H=>{var G;d.comment((G=H.value)!==null&&G!==void 0?G:"")},7:H=>{d.pi(H.name,H.value)},10:H=>{var G;d.doctype((G=H.value)!==null&&G!==void 0?G:"")},4:H=>{var G;d.cdata((G=H.value)!==null&&G!==void 0?G:"")},11:H=>{let G=H;if(G=G.firstChild)do B(G);while(G=G.next)}};d.reset();const B=H=>{var G;const le=$[H.type];if(le)le(H);else{const ue=H.name,ge=ue in l.getVoidElements();let Me=H.attributes;if(w&&Me&&Me.length>1){const He=[];He.map={};const $e=l.getElementRule(H.name);if($e){for(let Ve=0,rt=$e.attributesOrder.length;Ve<rt;Ve++){const ft=$e.attributesOrder[Ve];if(ft in Me.map){const ut=Me.map[ft];He.map[ft]=ut,He.push({name:ft,value:ut})}}for(let Ve=0,rt=Me.length;Ve<rt;Ve++){const ft=Me[Ve].name;if(!(ft in He.map)){const ut=Me.map[ft];He.map[ft]=ut,He.push({name:ft,value:ut})}}Me=He}}if(d.start(ue,Me,ge),Ed(ue))j(H.value)&&d.text(H.value,!0),d.end(ue);else if(!ge){let He=H.firstChild;if(He){(ue==="pre"||ue==="textarea")&&He.type===3&&((G=He.value)===null||G===void 0?void 0:G[0])===`
2024-08-22 17:59:06 +03:00
`&&d.text(`
2024-08-23 18:15:18 +03:00
`,!0);do B(He);while(He=He.next)}d.end(ue)}}};return v.type===1&&!s.inner?B(v):v.type===3?$[3](v):$[11](v),d.getContent()}}},Ao=new Set;Ne(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],l=>{Ao.add(l)});const R4=["font","text-decoration","text-emphasis"],TT=(s,l)=>ts(s.parseStyle(s.getAttrib(l,"style"))),C6=s=>Ao.has(s),yS=(s,l)=>Vs(TT(s,l),d=>!C6(d)),M4=s=>xt(s,l=>Ut(R4,d=>rr(l,d))),k6=(s,l,d)=>{const m=TT(s,l),v=TT(s,d),w=$=>{var B,H;const G=(B=s.getStyle(l,$))!==null&&B!==void 0?B:"",le=(H=s.getStyle(d,$))!==null&&H!==void 0?H:"";return Ls(G)&&Ls(le)&&G!==le};return Ut(m,$=>{const B=H=>Ut(H,G=>G===$);if(!B(v)&&B(R4)){const H=M4(v);return Ut(H,w)}else return w($)})},N4=(s,l,d)=>de.from(d.container()).filter(un).exists(m=>{const v=s?0:-1;return l(m.data.charAt(d.offset()+v))}),AT=Ue(N4,!0,Kb),qC=Ue(N4,!1,Kb),x6=s=>{const l=s.container();return un(l)&&(l.data.length===0||K(l.data)&&F1.isBookmarkNode(l.parentNode))},nO=(s,l)=>d=>Bn(s?0:-1,d).filter(l).isSome(),E6=s=>Ei(s)&&ki(qe.fromDom(s),"display")==="block",I4=s=>ys(s)&&!Xp(s),T6=nO(!0,E6),A6=nO(!1,E6),_S=nO(!0,Qr),Yy=nO(!1,Qr),B4=nO(!0,wd),hs=nO(!1,wd),W1=nO(!0,I4),Tp=nO(!1,I4),L4=s=>s.slice(0,-1),F4=(s,l,d)=>sn(l,s)?L4(rh(s,m=>d(m)||dt(m,l))):[],$T=(s,l)=>F4(s,l,Fe),Vg=(s,l)=>[s].concat($T(s,l)),XC=(s,l,d)=>Vf(s,l,d,x6),$6=s=>l=>s.isBlock(Os(l)),PT=(s,l,d)=>Gn(Vg(qe.fromDom(l.container()),s),$6(d)),H4=(s,l,d,m)=>XC(s,l.dom,d).forall(v=>PT(l,d,m).fold(()=>!_n(v,d,l.dom),w=>!_n(v,d,l.dom)&&sn(w,qe.fromDom(v.container())))),Q4=(s,l,d,m)=>PT(l,d,m).fold(()=>XC(s,l.dom,d).forall(v=>!_n(v,d,l.dom)),v=>XC(s,v.dom,d).isNone()),DT=Ue(Q4,!1),V4=Ue(Q4,!0),P6=Ue(H4,!1),D6=Ue(H4,!0),R6=s=>rc(s).exists(xu),jC=(s,l,d,m)=>{const v=xt(Vg(qe.fromDom(d.container()),l),$=>m.isBlock(Os($))),w=Oo(v).getOr(l);return zl(s,w.dom,d).filter(R6)},wS=(s,l,d)=>rc(l).exists(xu)||jC(!0,s,l,d).isSome(),SS=(s,l,d)=>nd(l).exists(xu)||jC(!1,s,l,d).isSome(),M6=Ue(jC,!1),N6=Ue(jC,!0),z4=s=>Dt.isTextPosition(s)&&!s.isAtStart()&&!s.isAtEnd(),W4=(s,l,d)=>{const m=xt(Vg(qe.fromDom(l.container()),s),v=>d.isBlock(Os(v)));return Oo(m).getOr(s)},Z4=(s,l,d)=>z4(l)?qC(l):qC(l)||Ru(W4(s,l,d).dom,l).exists(qC),U4=(s,l,d)=>z4(l)?AT(l):AT(l)||Uc(W4(s,l,d).dom,l).exists(AT),I6=s=>gt(["pre","pre-wrap"],s),RT=s=>rc(s).bind(l=>Ma(l,Ra)).exists(l=>I6(ki(l,"white-space"))),q4=(s,l)=>Ru(s.dom,l).isNone(),B6=(s,l)=>Uc(s.dom,l).isNone(),L6=(s,l,d)=>q4(s,l)||B6(s,l)||DT(s,l,d)||V4(s,l,d)||SS(s,l,d)||wS(s,l,d),oO=s=>Te(s)&&ys(s)&&Sm(s),X4=(s,l)=>d=>oO(new Hr(d,s)[l]()),j4=(s,l)=>{const d=Uc(s.dom,l).getOr(l),m=X4(s.dom,"next");return l.isAtEnd()&&(m(l.container())||m(d.container()))},F6=(s,l)=>{const d=Ru(s.dom,l).getOr(l),m=X4(s.dom,"prev");return l.isAtStart()&&(m(l.container())||m(d.container()))},Y4=(s,l,d)=>RT(l)?!1:L6(s,l,d)||Z4(s,l,d)||U4(s,l,d),Gy=(s,l,d)=>RT(l)?!1:DT(s,l,d)||P6(s,l,d)||SS(s,l,d)||Z4(s,l,d)||F6(s,l),G4=s=>{const l=s.container(),d=s.offset();return un(l)&&d<l.data.length?Dt(l,d+1):s},Ky=(s,l,d)=>RT(l)?!1:V4(s,l,d)||D6(s,l,d)||wS(s,l,d)||U4(s,l,d)||j4(s,l),YC=(s,l,d)=>Gy(s,l,d)||Ky(s,G4(l),d),Bu=(s,l)=>$y(s.charAt(l)),K4=(s,l)=>Kb(s.charAt(l)),H6=s=>{const l=s.container();return un(l)&&As(l.data,Fs)},Q6=s=>{const l=s.split("");return pt(l,(d,m)=>$y(d)&&m>0&&m<l.length-1&&Bg(l[m-1])&&Bg(l[m+1])?" ":d).join("")},J4=(s,l,d,m)=>{const v=l.data,w=Dt(l,0);return!d&&Bu(v,0)&&!YC(s,w,m)?(l.data=" "+v.slice(1),!0):d&&K4(v,0)&&Gy(s,w,m)?(l.data=Fs+v.slice(1),!0):!1},V6=s=>{const l=s.d
`+Ul),Br&&(Ul=Dm(Ul,qn," "),Ul=Dm(Ul,mo," "),Ul=Dm(Ul,es," ")),ut&&Xo?ut.createHTML(Ul):Ul},l.setConfig=function(xs){j2(xs),Hm=!0},l.clearConfig=function(){I0=null,Hm=!1},l.isValidAttribute=function(xs,Bt,so){I0||j2({});const $o=Yc(xs),Da=Yc(Bt);return GP($o,Da,so)},l.addHook=function(xs,Bt){typeof Bt=="function"&&(Jt[xs]=Jt[xs]||[],jg(Jt[xs],Bt))},l.removeHook=function(xs){if(Jt[xs])return h_(Jt[xs])},l.removeHooks=function(xs){Jt[xs]&&(Jt[xs]=[])},l.removeAllHooks=function(){Jt={}},l}var $R=qS();const PR=cn.each,m0=cn.trim,WA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],DR={ftp:21,http:80,https:443,mailto:25},XS=["img","video"],RR=(s,l)=>Te(s)?!s:Te(l)?!gt(XS,l):!0,ZA=s=>{try{return decodeURIComponent(s)}catch{return unescape(s)}},UA=(s,l,d)=>{const m=ZA(l).replace(/\s/g,"");return s.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(m)?!0:s.allow_html_data_urls?!1:/^data:image\//i.test(m)?RR(s.allow_svg_data_urls,d)&&/^data:image\/svg\+xml/i.test(m):/^data:/i.test(m)};class zh{static parseDataUri(l){let d;const m=decodeURIComponent(l).split(","),v=/data:([^;]+)/.exec(m[0]);return v&&(d=v[1]),{type:d,data:m[1]}}static isDomSafe(l,d,m={}){if(m.allow_script_urls)return!0;{const v=op.decode(l).replace(/[\s\u0000-\u001F]+/g,"");return!UA(m,v,d)}}static getDocumentBaseUrl(l){var d;let m;return l.protocol.indexOf("http")!==0&&l.protocol!=="file:"?m=(d=l.href)!==null&&d!==void 0?d:"":m=l.protocol+"//"+l.host+l.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(m)&&(m=m.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(m)||(m+="/")),m}constructor(l,d={}){this.path="",this.directory="",l=m0(l),this.settings=d;const m=d.base_uri,v=this;if(/^([\w\-]+):([^\/]{2})/i.test(l)||/^\s*#/.test(l)){v.source=l;return}const w=l.indexOf("//")===0;if(l.indexOf("/")===0&&!w&&(l=(m&&m.protocol||"http")+"://mce_host"+l),!/^[\w\-]*:?\/\//.test(l)){const B=m?m.path:new zh(document.location.href).directory;if((m==null?void 0:m.protocol)==="")l="//mce_host"+v.toAbsPath(B,l);else{const H=/([^#?]*)([#?]?.*)/.exec(l);H&&(l=(m&&m.protocol||"http")+"://mce_host"+v.toAbsPath(B,H[1])+H[2])}}l=l.replace(/@@/g,"(mce_at)");const $=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(l);$&&PR(WA,(B,H)=>{let G=$[H];G&&(G=G.replace(/\(mce_at\)/g,"@@")),v[B]=G}),m&&(v.protocol||(v.protocol=m.protocol),v.userInfo||(v.userInfo=m.userInfo),!v.port&&v.host==="mce_host"&&(v.port=m.port),(!v.host||v.host==="mce_host")&&(v.host=m.host),v.source=""),w&&(v.protocol="")}setPath(l){const d=/^(.*?)\/?(\w+)?$/.exec(l);d&&(this.path=d[0],this.directory=d[1],this.file=d[2]),this.source="",this.getURI()}toRelative(l){if(l==="./")return l;const d=new zh(l,{base_uri:this});if(d.host!=="mce_host"&&this.host!==d.host&&d.host||this.port!==d.port||this.protocol!==d.protocol&&d.protocol!=="")return d.getURI();const m=this.getURI(),v=d.getURI();if(m===v||m.charAt(m.length-1)==="/"&&m.substr(0,m.length-1)===v)return m;let w=this.toRelPath(this.path,d.path);return d.query&&(w+="?"+d.query),d.anchor&&(w+="#"+d.anchor),w}toAbsolute(l,d){const m=new zh(l,{base_uri:this});return m.getURI(d&&this.isSameOrigin(m))}isSameOrigin(l){if(this.host==l.host&&this.protocol==l.protocol){if(this.port==l.port)return!0;const d=this.protocol?DR[this.protocol]:null;if(d&&(this.port||d)==(l.port||d))return!0}return!1}toRelPath(l,d){let m=0,v="",w,$;const B=l.substring(0,l.lastIndexOf("/")).split("/"),H=d.split("/");if(B.length>=H.length){for(w=0,$=B.length;w<$;w++)if(w>=H.length||B[w]!==H[w]){m=w+1;break}}if(B.length<H.length){for(w=0,$=H.length;w<$;w++)if(w>=B.length||B[w]!==H[w]){m=w+1;break}}if(m===1)return d;for(w=0,$=B.length-(m-1);w<$;w++)v+="../";for(w=m-1,$=H.length;w<$;w++)w!==m-1?v+="/"+H[w]:v+=H[w];return v}toAbsPath(l,d){let m=0;const v=/\/$/.test(d)?"/":"",w=l.split("/"),$=d.split("/"),B=[];PR(w,ue=>{ue&&B.push(ue)});const H=[];for(let ue=$
2024-08-22 17:59:06 +03:00
`).replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let B=m.length;for(;B--;){const H=m[B],G=H.firstChild,le=(w=G==null?void 0:G.value)!==null&&w!==void 0?w:"";if(v==="script"){const ue=H.attr("type");ue&&H.attr("type",ue==="mce-no/type"?null:ue.replace(/^mce\-/,"")),l.element_format==="xhtml"&&G&&le.length>0&&(G.value=`// <![CDATA[
`+$(le)+`
// ]]>`)}else l.element_format==="xhtml"&&G&&le.length>0&&(G.value=`<!--
`+$(le)+`
2024-08-23 18:15:18 +03:00
-->`)}}),s.addNodeFilter("#comment",m=>{let v=m.length;for(;v--;){const w=m[v],$=w.value;l.preserve_cdata&&($==null?void 0:$.indexOf("[CDATA["))===0?(w.name="#cdata",w.type=4,w.value=d.decode($.replace(/^\[CDATA\[|\]\]$/g,""))):($==null?void 0:$.indexOf("mce:protected "))===0&&(w.name="#text",w.type=3,w.raw=!0,w.value=unescape($).substr(14))}}),s.addNodeFilter("xml:namespace,input",(m,v)=>{let w=m.length;for(;w--;){const $=m[w];$.type===7?$.remove():$.type===1&&v==="input"&&!$.attr("type")&&$.attr("type","text")}}),s.addAttributeFilter("data-mce-type",m=>{Ne(m,v=>{v.attr("data-mce-type")==="format-caret"&&(v.isEmpty(s.schema.getNonEmptyElements())?v.remove():v.unwrap())})}),s.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(m,v)=>{let w=m.length;for(;w--;)m[w].attr(v,null)}),l.remove_trailing_brs&&NA(l,s,s.schema)},JS=s=>{const l=m=>(m==null?void 0:m.name)==="br",d=s.lastChild;if(l(d)){const m=d.prev;l(m)&&(d.remove(),m.remove())}},fM=(s,l,d)=>{let m;const v=s.dom;let w=l.cloneNode(!0);const $=document.implementation;if($.createHTMLDocument){const B=$.createHTMLDocument("");cn.each(w.nodeName==="BODY"?w.childNodes:[w],H=>{B.body.appendChild(B.importNode(H,!0))}),w.nodeName!=="BODY"?w=B.body.firstChild:w=B.body,m=v.doc,v.doc=B}return lS(s,{...d,node:w}),m&&(v.doc=m),w},hM=(s,l)=>Te(s)&&s.hasEventListeners("PreProcess")&&!l.no_events,l8=(s,l,d)=>hM(s,d)?fM(s,l,d):l,mM=(s,l,d)=>{cn.inArray(l,d)===-1&&(s.addAttributeFilter(d,(m,v)=>{let w=m.length;for(;w--;)m[w].attr(v,null)}),l.push(d))},c8=(s,l,d)=>!l.no_events&&s?eT(s,{...l,content:d}).content:d,u8=(s,l,d)=>{const m=ve(d.getInner?l.innerHTML:s.getOuterHTML(l));return d.selection||ya(qe.fromDom(l))?m:cn.trim(m)},d8=(s,l,d)=>{const m=d.selection?{forced_root_block:!1,...d}:d,v=s.parse(l,m);return JS(v),v},f8=(s,l,d)=>u0(s,l).serialize(d),pM=(s,l,d,m,v)=>{const w=f8(l,d,m);return c8(s,v,w)},h8=(s,l)=>{const d=["data-mce-selected"],m={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...s},v=l&&l.dom?l.dom:Jr.DOM,w=l&&l.schema?l.schema:Df(m),$=Mm(m,w);b_($,m,v);const B=(H,G={})=>{const le={format:"html",...G},ue=l8(l,H,le),ge=u8(v,ue,le),Me=d8($,ge,le);return le.format==="tree"?Me:pM(l,m,w,Me,le)};return{schema:w,addNodeFilter:$.addNodeFilter,addAttributeFilter:$.addAttributeFilter,serialize:B,addRules:w.addValidElements,setRules:w.setValidElements,addTempAttr:Ue(mM,$,d),getTempAttrs:je(d),getNodeFilters:$.getNodeFilters,getAttributeFilters:$.getAttributeFilters,removeNodeFilter:$.removeNodeFilter,removeAttributeFilter:$.removeAttributeFilter}},gM=(s,l)=>{const d=h8(s,l);return{schema:d.schema,addNodeFilter:d.addNodeFilter,addAttributeFilter:d.addAttributeFilter,serialize:d.serialize,addRules:d.addRules,setRules:d.setRules,addTempAttr:d.addTempAttr,getTempAttrs:d.getTempAttrs,getNodeFilters:d.getNodeFilters,getAttributeFilters:d.getAttributeFilters,removeNodeFilter:d.removeNodeFilter,removeAttributeFilter:d.removeAttributeFilter}},e2="html",bM=(s,l)=>({...s,format:l,get:!0,getInner:!0}),vM=(s,l={})=>{const d=l.format?l.format:e2,m=bM(l,d);return p0(s,m).fold(mn,v=>{const w=XF(s,v);return jA(s,w,v)})},m8="html",p8=(s,l)=>({format:m8,...s,set:!0,content:l}),O3=(s,l,d={})=>{const m=p8(d,l);return YA(s,m).map(v=>{const w=jF(s,v.content,v);return Rk(s,w.html,v),w.content}).getOr(l)},OM="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_r
2024-08-22 17:59:06 +03:00
- `,H=$?`
Themes:${B}mobile`:"",G=v?`
Plugins:${B}${m.join(B)}`:"",le=w?`
Options:${B}${d.join(B)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+H+G+le)}},_8=s=>Gn(yM,l=>l.name===s).fold(()=>s,l=>l.replacedWith?`${s}, replaced by ${l.replacedWith}`:s),$r=(s,l)=>{const d=Dp(s),m=O8(l),v=m.length>0,w=d.length>0;if(v||w){const $=`
- `,B=v?`
Plugins:${$}${m.map(_8).join($)}`:"",H=w?`
2024-08-23 18:15:18 +03:00
Options:${$}${d.join($)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+B+H)}},EU=(s,l)=>{y8(s,l),$r(s,l)},Zk=Jr.DOM,w8=s=>{Zk.setStyle(s.id,"display",s.orgDisplay)},$i=s=>de.from(s).each(l=>l.destroy()),S8=s=>{const l=s;l.contentAreaContainer=l.formElement=l.container=l.editorContainer=null,l.bodyElement=l.contentDocument=l.contentWindow=null,l.iframeElement=l.targetElm=null;const d=s.selection;if(d){const m=d.dom;l.selection=d.win=d.dom=m.doc=null}},t2=s=>{const l=s.formElement;l&&(l._mceOldSubmit&&(l.submit=l._mceOldSubmit,delete l._mceOldSubmit),Zk.unbind(l,"submit reset",s.formEventDelegate))},C8=s=>{if(!s.removed){const{_selectionOverrides:l,editorUpload:d}=s,m=s.getBody(),v=s.getElement();m&&s.save({is_removing:!0}),s.removed=!0,s.unbindAllNativeEvents(),s.hasHiddenInput&&Te(v==null?void 0:v.nextSibling)&&Zk.remove(v.nextSibling),o0(s),s.editorManager.remove(s),!s.inline&&m&&w8(s),s0(s),Zk.remove(s.getContainer()),$i(l),$i(d),s.destroy()}},k8=(s,l)=>{const{selection:d,dom:m}=s;if(!s.destroyed){if(!l&&!s.removed){s.remove();return}l||(s.editorManager.off("beforeunload",s._beforeUnload),s.theme&&s.theme.destroy&&s.theme.destroy(),$i(d),$i(m)),t2(s),S8(s),s.destroyed=!0}},n2=(()=>{const s={};return{add:(v,w)=>{s[v]=w},get:v=>s[v]?s[v]:{icons:{}},has:v=>an(s,v)}})(),Zh=nc.ModelManager,zd=(s,l)=>l.dom[s],v_=(s,l)=>parseInt(ki(l,s),10),v0=Ue(zd,"clientWidth"),Gg=Ue(zd,"clientHeight"),o2=Ue(v_,"margin-top"),y3=Ue(v_,"margin-left"),_3=s=>s.dom.getBoundingClientRect(),wM=(s,l,d)=>{const m=v0(s),v=Gg(s);return l>=0&&d>=0&&l<=m&&d<=v},SM=(s,l,d,m)=>{const v=_3(l),w=s?v.left+l.dom.clientLeft+y3(l):0,$=s?v.top+l.dom.clientTop+o2(l):0,B=d-w,H=m-$;return{x:B,y:H}},x8=(s,l,d)=>{const m=qe.fromDom(s.getBody()),v=s.inline?m:ps(m),w=SM(s.inline,v,l,d);return wM(v,w.x,w.y)},E8=s=>de.from(s).map(qe.fromDom),CM=s=>{const l=s.inline?s.getBody():s.getContentAreaContainer();return E8(l).map(ef).getOr(!1)};var kM=()=>{const s=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:s,close:s,getArgs:s}};const w3=s=>{const l=[],d=()=>{const ge=s.theme;return ge&&ge.getNotificationManagerImpl?ge.getNotificationManagerImpl():kM()},m=()=>de.from(l[0]),v=(ge,Me)=>ge.type===Me.type&&ge.text===Me.text&&!ge.progressBar&&!ge.timeout&&!Me.progressBar&&!Me.timeout,w=()=>{Ne(l,ge=>{ge.reposition()})},$=ge=>{l.push(ge)},B=ge=>{as(l,Me=>Me===ge).each(Me=>{l.splice(Me,1)})},H=(ge,Me=!0)=>s.removed||!CM(s)?{}:(Me&&s.dispatch("BeforeOpenNotification",{notification:ge}),Gn(l,He=>v(d().getArgs(He),ge)).getOrThunk(()=>{s.editorManager.setActive(s);const He=d().open(ge,()=>{B(He),w(),b4(s)&&m().fold(()=>s.focus(),$e=>NC(qe.fromDom($e.getEl())))});return $(He),w(),s.dispatch("OpenNotification",{notification:{...He}}),He})),G=()=>{m().each(ge=>{d().close(ge),B(ge),w()})},le=je(l);return(ge=>{ge.on("SkinLoaded",()=>{const Me=kw(ge);Me&&H({text:Me,type:"warning",timeout:0},!1),w()}),ge.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(w)}),ge.on("remove",()=>{Ne(l.slice(),Me=>{d().close(Me)})})})(s),{open:H,close:G,getNotifications:le}},hO=nc.PluginManager,G1=nc.ThemeManager;var AU=()=>{const s=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:s,openUrl:s,alert:s,confirm:s,close:s}};const xM=s=>{let l=[];const d=()=>{const $e=s.theme;return $e&&$e.getWindowManagerImpl?$e.getWindowManagerImpl():AU()},m=($e,Ve)=>(...rt)=>Ve?Ve.apply($e,rt):void 0,v=$e=>{s.dispatch("OpenWindow",{dialog:$e})},w=$e=>{s.dispatch("CloseWindow",{dialog:$e})},$=$e=>{l.push($e),v($e)},B=$e=>{w($e),l=xt(l,Ve=>Ve!==$e),l.length===0&&s.focus()},H=()=>de.from(l[l.length-1]),G=$e=>{s.editorManager.setActive(s),jy(s),s.ui.show();const Ve=$e();return $(Ve),Ve},le=($e,Ve)=>G(()=>d().open($e,Ve,B)),ue=$e=>G(()=>d().openUrl($e,B)),ge=($e,Ve,rt)=>{const ft=d();ft.alert($e,m(rt||ft,Ve))},Me=($e,Ve,rt)=>{const ft=d();ft.confirm($e,m(rt||ft,Ve))},He=()=>{H().each($e=>{d().close($e),B($e)})};return s.on("remove",()=>{Ne(l,$e=>{d().close($e)})}),{op
\r \v`.indexOf(s)!==-1,OO=(s,l)=>s.substring(l.length),C2=(s,l,d)=>{let m;const v=d.charAt(0);for(m=l-1;m>=0;m--){const w=s.charAt(m);if(S2(w))return de.none();if(v===w&&As(s,d,m,l))break}return de.some(m)},Fm=(s,l,d,m=0)=>{if(!fN(l))return de.none();const v={text:"",offset:0},w=(B,H,G)=>(v.text=G+v.text,v.offset+=H,C2(v.text,v.offset,d).getOr(H)),$=s.getParent(l.startContainer,s.isBlock)||s.getRoot();return _2(s,l.startContainer,l.startOffset,w,$).bind(B=>{const H=l.cloneRange();if(H.setStart(B.container,B.offset),H.setEnd(l.endContainer,l.endOffset),H.collapsed)return de.none();const G=w2(H);return G.lastIndexOf(d)!==0||OO(G,d).length<m?de.none():de.some({text:OO(G,d),range:H,trigger:d})})},P_=(s,l,d,m=0)=>h6(qe.fromDom(l.startContainer)).fold(()=>Fm(s,l,d,m),v=>{const w=s.createRng();w.selectNode(v.dom);const $=w2(w);return de.some({range:w,text:OO($,d),trigger:d})}),hN=s=>s.nodeType===th,mN=s=>s.nodeType===dc,pN=s=>{if(hN(s))return Lm(s,s.data.length);{const l=s.childNodes;return l.length>0?pN(l[l.length-1]):Lm(s,l.length)}},C$=(s,l)=>{const d=s.childNodes;return d.length>0&&l<d.length?C$(d[l],0):d.length>0&&mN(s)&&d.length===l?pN(d[d.length-1]):Lm(s,l)},jH=(s,l)=>{var d;const m=(d=s.getParent(l.container,s.isBlock))!==null&&d!==void 0?d:s.getRoot();return _2(s,l.container,l.offset,(v,w)=>w===0?-1:w,m).filter(v=>{const w=v.container.data.charAt(v.offset-1);return!S2(w)}).isSome()},YH=s=>l=>{const d=C$(l.startContainer,l.startOffset);return!jH(s,d)},k2=(s,l,d)=>ws(d.triggers,m=>P_(s,l,m)),GH=(s,l)=>{const d=l(),m=s.selection.getRng();return k2(s.dom,m,d).bind(v=>gN(s,l,v))},gN=(s,l,d,m={})=>{var v;const w=l(),B=(v=s.selection.getRng().startContainer.nodeValue)!==null&&v!==void 0?v:"",H=xt(w.lookupByTrigger(d.trigger),le=>d.text.length>=le.minChars&&le.matches.getOrThunk(()=>YH(s.dom))(d.range,B,d.text));if(H.length===0)return de.none();const G=Promise.all(pt(H,le=>le.fetch(d.text,le.maxResults,m).then(ge=>({matchText:d.text,items:ge,columns:le.columns,onAction:le.onAction,highlightOn:le.highlightOn}))));return de.some({lookupData:G,context:d})};var Np;(function(s){s[s.Error=0]="Error",s[s.Value=1]="Value"})(Np||(Np={}));const k$=(s,l,d)=>s.stype===Np.Error?l(s.serror):d(s.svalue),KH=s=>{const l=[],d=[];return Ne(s,m=>{k$(m,v=>d.push(v),v=>l.push(v))}),{values:l,errors:d}},JH=(s,l)=>s.stype===Np.Error?{stype:Np.Error,serror:l(s.serror)}:s,eQ=(s,l)=>s.stype===Np.Value?{stype:Np.Value,svalue:l(s.svalue)}:s,tQ=(s,l)=>s.stype===Np.Value?l(s.svalue):s,nQ=(s,l)=>s.stype===Np.Error?l(s.serror):s,bN=s=>({stype:Np.Value,svalue:s}),vN=s=>({stype:Np.Error,serror:s}),jc={fromResult:s=>s.fold(vN,bN),toResult:s=>k$(s,zc.error,zc.value),svalue:bN,partition:KH,serror:vN,bind:tQ,bindError:nQ,map:eQ,mapError:JH,fold:k$},kx=s=>ae(s)&&ts(s).length>100?" removed due to size":JSON.stringify(s,null,2),ON=s=>{const l=s.length>10?s.slice(0,10).concat([{path:[],getErrorInfo:je("... (only showing first ten failures)")}]):s;return pt(l,d=>"Failed path: ("+d.path.join(" > ")+`)
2024-08-22 17:59:06 +03:00
`+d.getErrorInfo())},x2=(s,l)=>jc.serror([{path:s,getErrorInfo:l}]),oQ=(s,l,d)=>x2(s,()=>'Could not find valid *required* value for "'+l+'" in '+kx(d)),sQ=(s,l)=>x2(s,()=>'Choice schema did not contain choice key: "'+l+'"'),rQ=(s,l,d)=>x2(s,()=>'The chosen schema: "'+d+'" did not exist in branches: '+kx(l)),iQ=(s,l)=>x2(s,je(l)),yN=(s,l,d,m)=>ro(d,m).fold(()=>rQ(s,d,m),w=>w.extract(s.concat(["branch: "+m]),l)),aQ=(s,l)=>({extract:(v,w)=>ro(w,s).fold(()=>sQ(v,s),B=>yN(v,w,l,B)),toString:()=>"chooseOn("+s+"). Possible values: "+ts(l)}),_N=(s,l)=>l,lQ=(s,l)=>fe(s)&&fe(l)?E2(s,l):l,x$=s=>(...l)=>{if(l.length===0)throw new Error("Can't merge zero objects");const d={};for(let m=0;m<l.length;m++){const v=l[m];for(const w in v)an(v,w)&&(d[w]=s(d[w],v[w]))}return d},E2=x$(lQ),cQ=x$(_N),wN=()=>({tag:"required",process:{}}),uQ=s=>({tag:"defaultedThunk",process:s}),E$=s=>uQ(je(s)),dQ=()=>({tag:"option",process:{}}),fQ=(s,l)=>s.length>0?jc.svalue(E2(l,cQ.apply(void 0,s))):jc.svalue(l),T$=s=>q(jc.serror,vr)(s),SN={consolidateObj:(s,l)=>{const d=jc.partition(s);return d.errors.length>0?T$(d.errors):fQ(d.values,l)},consolidateArr:s=>{const l=jc.partition(s);return l.errors.length>0?T$(l.errors):jc.svalue(l.values)}},hQ=(s,l,d,m)=>({tag:"field",key:s,newKey:l,presence:d,prop:m}),mQ=(s,l)=>({tag:"custom",newKey:s,instantiator:l}),CN=(s,l,d)=>{switch(s.tag){case"field":return l(s.key,s.newKey,s.presence,s.prop);case"custom":return d(s.newKey,s.instantiator)}},xx=s=>{const l=(m,v)=>jc.bindError(s(v),w=>iQ(m,w)),d=je("val");return{extract:l,toString:d}},kN=xx(jc.svalue),pQ=(s,l,d,m)=>ro(l,d).fold(()=>oQ(s,d,l),m),xN=(s,l,d,m)=>{const v=ro(s,l).getOrThunk(()=>d(s));return m(v)},gQ=(s,l,d)=>d(ro(s,l)),bQ=(s,l,d,m)=>{const v=ro(s,l).map(w=>w===!0?d(s):w);return m(v)},vQ=(s,l,d,m,v)=>{const w=B=>v.extract(l.concat([m]),B),$=B=>B.fold(()=>jc.svalue(de.none()),H=>{const G=v.extract(l.concat([m]),H);return jc.map(G,de.some)});switch(s.tag){case"required":return pQ(l,d,m,w);case"defaultedThunk":return xN(d,m,s.process,w);case"option":return gQ(d,m,$);case"defaultedOptionThunk":return bQ(d,m,s.process,$);case"mergeWithThunk":return xN(d,m,je({}),B=>{const H=E2(s.process(d),B);return w(H)})}},OQ=(s,l,d)=>{const m={},v=[];for(const w of d)CN(w,($,B,H,G)=>{const le=vQ(H,s,l,$,G);jc.fold(le,ue=>{v.push(...ue)},ue=>{m[B]=ue})},($,B)=>{m[$]=B(l)});return v.length>0?jc.serror(v):jc.svalue(m)},A$=s=>({extract:(m,v)=>OQ(m,v,s),toString:()=>`obj{
`+pt(s,v=>CN(v,(w,$,B,H)=>w+" -> "+H.toString(),(w,$)=>"state("+w+")")).join(`
`)+"}"}),EN=s=>({extract:(m,v)=>{const w=pt(v,($,B)=>s.extract(m.concat(["["+B+"]"]),$));return SN.consolidateArr(w)},toString:()=>"array("+s.toString()+")"}),WU=s=>xx(l=>s(l).fold(jc.serror,jc.svalue)),yQ=(s,l,d)=>{const m=l.extract([s],d);return jc.mapError(m,v=>({input:d,errors:v}))},Ex=(s,l,d)=>jc.toResult(yQ(s,l,d)),TN=s=>`Errors:
`+ON(s.errors).join(`
`)+`
2024-08-23 18:15:18 +03:00
Input object: `+kx(s.input),$$=(s,l)=>aQ(s,ns(l,A$)),_Q=je(kN),T2=(s,l)=>xx(d=>{const m=typeof d;return s(d)?jc.svalue(d):jc.serror(`Expected type: ${l} but got: ${m}`)}),AN=T2(yt,"number"),Tx=T2(j,"string"),wQ=T2(Se,"boolean"),P$=T2(Oe,"function"),D_=hQ,$N=mQ,D$=s=>WU(l=>gt(s,l)?zc.value(l):zc.error(`Unsupported value: "${l}", choose one of "${s.join(", ")}".`)),PN=(s,l)=>D_(s,s,wN(),l),DN=s=>PN(s,Tx),RN=s=>PN(s,P$),MN=(s,l)=>D_(s,s,wN(),EN(l)),R$=(s,l)=>D_(s,s,dQ(),l),Ax=s=>R$(s,Tx),SQ=s=>R$(s,P$),CQ=(s,l)=>D_(s,s,E$(l),_Q()),R_=(s,l,d)=>D_(s,s,E$(l),d),$l=(s,l)=>R_(s,l,AN),t1=(s,l)=>R_(s,l,Tx),NN=(s,l,d)=>R_(s,l,D$(d)),IN=(s,l)=>R_(s,l,wQ),M$=(s,l)=>R_(s,l,P$),kQ=(s,l,d)=>R_(s,l,EN(d)),xQ=DN("type"),EQ=RN("fetch"),$x=RN("onAction"),M_=M$("onSetup",()=>St),ZU=Ax("text"),TQ=Ax("icon"),AQ=Ax("tooltip"),Ip=Ax("label"),$Q=IN("active",!1),PQ=IN("enabled",!0),N$=IN("primary",!1),DQ=s=>CQ("columns",s),yO=s=>t1("type",s),BN=A$([xQ,DN("trigger"),$l("minChars",1),DQ(1),$l("maxResults",10),SQ("matches"),EQ,$x,kQ("highlightOn",[],Tx)]),RQ=s=>Ex("Autocompleter",BN,{trigger:s.ch,...s}),I$=[PQ,AQ,TQ,ZU,M_],LN=[$Q].concat(I$),FN=[M$("predicate",Fe),NN("scope","node",["node","editor"]),NN("position","selection",["node","selection","line"])],HN=I$.concat([yO("contextformbutton"),N$,$x,$N("original",mn)]),B$=LN.concat([yO("contextformbutton"),N$,$x,$N("original",mn)]),L$=I$.concat([yO("contextformbutton")]),F$=LN.concat([yO("contextformtogglebutton")]),MQ=$$("type",{contextformbutton:HN,contextformtogglebutton:B$});A$([yO("contextform"),M$("initValue",je("")),Ip,MN("commands",MQ),R$("launch",$$("type",{contextformbutton:L$,contextformtogglebutton:F$}))].concat(FN));const NQ=s=>{const l=s.ui.registry.getAll().popups,d=ns(l,$=>RQ($).fold(B=>{throw new Error(TN(B))},mn)),m=Wo(Rn(d,$=>$.trigger)),v=Xn(d);return{dataset:d,triggers:m,lookupByTrigger:$=>xt(v,B=>B.trigger===$)}},IQ=(s,l)=>{const d=_b(l.load,50);s.on("keypress compositionend",m=>{m.which!==27&&d.throttle()}),s.on("keydown",m=>{const v=m.which;v===8?d.throttle():v===27&&l.cancelIfNecessary()}),s.on("remove",d.cancel)},BQ=s=>{const l=fm(),d=Ai(!1),m=l.isSet,v=()=>{m()&&(e8(s),fS(s),d.set(!1),l.clear())},w=G=>{m()||(JF(s,G.range),l.set({trigger:G.trigger,matchLength:G.text.length}))},$=Qt(()=>NQ(s)),B=G=>l.get().map(le=>P_(s.dom,s.selection.getRng(),le.trigger).bind(ue=>gN(s,$,ue,G))).getOrThunk(()=>GH(s,$)),H=G=>{B(G).fold(v,le=>{w(le.context),le.lookupData.then(ue=>{l.get().map(ge=>{const Me=le.context;ge.trigger===Me.trigger&&(Me.text.length-ge.matchLength>=10?v():(l.set({...ge,matchLength:Me.text.length}),d.get()?EC(s,{lookupData:ue}):(d.set(!0),dS(s,{lookupData:ue}))))})})})};s.addCommand("mceAutocompleterReload",(G,le)=>{const ue=ae(le)?le.fetchOptions:{};H(ue)}),s.addCommand("mceAutocompleterClose",v),IQ(s,{cancelIfNecessary:v,load:H})},VN=Ko().browser.isSafari(),zN=s=>Sd(qe.fromDom(s)),H$=(s,l)=>{var d;return s.startOffset===0&&s.endOffset===((d=l.textContent)===null||d===void 0?void 0:d.length)},Px=(s,l)=>de.from(s.getParent(l.container(),"details")),Dx=(s,l)=>Px(s,l).isSome(),LQ=(s,l)=>{const d=de.from(s.getParent(l.startContainer,"details")),m=de.from(s.getParent(l.endContainer,"details"));if(d.isSome()||m.isSome()){const v=d.bind(w=>de.from(s.select("summary",w)[0]));return de.some({startSummary:v,startDetails:d,endDetails:m})}else return de.none()},FQ=(s,l)=>hu(l).exists(d=>d.isEqual(s)),HQ=(s,l)=>zf(l).exists(d=>Js(d.getNode())&&Ru(l,d).exists(m=>m.isEqual(s))||d.isEqual(s)),QQ=(s,l)=>l.startSummary.exists(d=>FQ(s,d)),VQ=(s,l)=>l.startSummary.exists(d=>HQ(s,d)),WN=(s,l)=>l.startDetails.exists(d=>Ru(d,s).forall(m=>l.startSummary.exists(v=>!v.contains(s.container())&&v.contains(m.container())))),Q$=(s,l,d)=>d.startDetails.exists(m=>Uc(s,l).forall(v=>!m.contains(v.container()))),V$=(s,l)=>{const d=l.getNode();De(d)||s.selection.setCursorLocation(d,l.offset())},z$=(s,l,d)=>{const m=s.dom.getParent(l.container(),"details");if(m&&!m.open){const v=s.dom.select("summary",m)[0];v&&(d?hu(v):zf(v)).each($=>V$(s,$))}else V$(s,l)},zQ=(s,l)=>{const d=H=>H.contains(s.startContainer)
2024-08-22 17:59:06 +03:00
`;return}if(G!=="wbr"){if(v[G]&&(m+=" "),w[G]){m+=" ";return}if(H.type===3&&(m+=H.value),!(H.name in l.getVoidElements())){let ue=H.firstChild;if(ue)do B(ue);while(ue=ue.next)}$[G]&&le.next&&(m+=`
`,G==="p"&&(m+=`
`))}};return s=PI(s,[/<!\[[^\]]+\]>/g]),B(d.parse(s)),m},DI=s=>(s=PI(s,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(d,m,v)=>!m&&!v?" ":Fs],/<br class="Apple-interchange-newline">/g,/<br>$/i]),s),YV=s=>{let l=0;return()=>s+l++},GV=s=>{const l=s.toLowerCase(),d={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return cn.hasOwn(d,l)?"image/"+d[l]:"image/"+l},fi=(s,l)=>{const d=Mm({sanitize:_m(s),sandbox_iframes:Wb(s)},s.schema);d.addNodeFilter("meta",v=>{cn.each(v,w=>{w.remove()})});const m=d.parse(l,{forced_root_block:!1,isRootContent:!0});return u0({validate:!0},s.schema).serialize(m)},RI=(s,l)=>({content:s,cancelled:l}),MI=(s,l,d)=>{const m=s.dom.create("div",{style:"display:none"},l),v=rT(s,m,d);return RI(v.node.innerHTML,v.isDefaultPrevented())},KV=(s,l,d)=>{const m=sT(s,l,d),v=fi(s,m.content);return s.hasEventListeners("PastePostProcess")&&!m.isDefaultPrevented()?MI(s,v,d):RI(v,m.isDefaultPrevented())},dP=(s,l,d)=>KV(s,l,d),Kx=(s,l)=>(s.insertContent(l,{merge:Sv(s),paste:!0}),!0),fP=s=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(s),JV=(s,l)=>fP(l)&&Ut(vy(s),d=>Vi(l.toLowerCase(),`.${d.toLowerCase()}`)),NI=(s,l,d)=>(s.undoManager.extra(()=>{d(s,l)},()=>{s.insertContent('<img src="'+l+'">')}),!0),hP=(s,l,d)=>(s.undoManager.extra(()=>{d(s,l)},()=>{s.execCommand("mceInsertLink",!1,l)}),!0),ez=(s,l,d)=>!s.selection.isCollapsed()&&fP(l)?hP(s,l,d):!1,tz=(s,l,d)=>JV(s,l)?NI(s,l,d):!1,nz=(s,l)=>{cn.each([ez,tz,Kx],d=>!d(s,l,Kx))},II=(s,l,d)=>{d||!Hb(s)?Kx(s,l):nz(s,l)},oz=YV("mceclip"),sz=s=>{const l=aP();return xI(l,s),iP(l),l},wO=(s,l,d,m,v)=>{const w=dP(s,l,d);if(!w.cancelled){const $=w.content,B=()=>II(s,$,m);v?W$(s,"insertFromPaste",{dataTransfer:sz($)}).isDefaultPrevented()||(B(),A2(s,"insertFromPaste")):B()}},Jx=(s,l,d,m)=>{const v=d||TI(l);wO(s,EI(l),v,!1,m)},A0=(s,l,d)=>{const m=s.dom.encode(l).replace(/\r\n/g,`
2024-08-23 18:15:18 +03:00
`),v=mh(m,gy(s)),w=Gx(v,Vl(s),Om(s));wO(s,w,!1,!0,d)},L_=s=>{const l={};if(s&&s.types)for(let d=0;d<s.types.length;d++){const m=s.types[d];try{l[m]=s.getData(m)}catch{l[m]=""}}return l},$0=(s,l)=>l in s&&s[l].length>0,BI=s=>$0(s,"text/html")||$0(s,"text/plain"),F_=(s,l)=>{const d=l.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return Te(d)?s.dom.encode(d[1]):void 0},rz=(s,l,d,m)=>{const v=oz(),w=A1(s)&&Te(d.name),$=w?F_(s,d.name):v,B=w?d.name:void 0,H=l.create(v,d,m,$,B);return l.add(H),H},mP=(s,l)=>{xk(l.uri).each(({data:d,type:m,base64Encoded:v})=>{const w=v?d:btoa(d),$=l.file,B=s.editorUpload.blobCache,H=B.getByData(w,m),G=H??rz(s,B,$,w);Jx(s,`<img src="${G.blobUri()}">`,!1,!0)})},iz=s=>s.type==="paste",LI=s=>Promise.all(pt(s,l=>X7(l).then(d=>({file:l,uri:d})))),FI=s=>{const l=vy(s);return d=>rr(d.type,"image/")&&Ut(l,m=>GV(m)===d.type)},pP=(s,l)=>{const d=l.items?Ns(Gs(l.items),v=>v.kind==="file"?[v.getAsFile()]:[]):[],m=l.files?Gs(l.files):[];return xt(d.length>0?d:m,FI(s))},gP=(s,l,d)=>{const m=iz(l)?l.clipboardData:l.dataTransfer;if(Fb(s)&&m){const v=pP(s,m);if(v.length>0)return l.preventDefault(),LI(v).then(w=>{d&&s.selection.setRng(d),Ne(w,$=>{mP(s,$)})}),!0}return!1},az=s=>{var l,d;return Mn.os.isAndroid()&&((d=(l=s.clipboardData)===null||l===void 0?void 0:l.items)===null||d===void 0?void 0:d.length)===0},lz=s=>zn.metaKeyPressed(s)&&s.keyCode===86||s.shiftKey&&s.keyCode===45,eE=(s,l,d,m,v)=>{let w=DI(d);const $=$0(l,Yx())||TI(d),B=!$&&zV(w),H=fP(w);($I(w)||!w.length||B&&!H)&&(m=!0),(m||H)&&($0(l,"text/plain")&&B?w=l["text/plain"]:w=jV(w)),!$I(w)&&(m?A0(s,w,v):Jx(s,w,$,v))},cz=(s,l,d)=>{let m;const v=()=>l.getLastRng()||s.selection.getRng();s.on("keydown",w=>{lz(w)&&!w.isDefaultPrevented()&&(m=w.shiftKey&&w.keyCode===86)}),s.on("paste",w=>{if(w.isDefaultPrevented()||az(w))return;const $=d.get()==="text"||m;m=!1;const B=L_(w.clipboardData);!BI(B)&&gP(s,w,v())||($0(B,"text/html")?(w.preventDefault(),eE(s,B,B["text/html"],$,!0)):$0(B,"text/plain")&&$0(B,"text/uri-list")?(w.preventDefault(),eE(s,B,B["text/plain"],$,!0)):(l.create(),Uf.setEditorTimeout(s,()=>{const H=l.getHtml();l.remove(),eE(s,B,H,$,!1)},0)))})},HI=s=>{const l=v=>rr(v,"webkit-fake-url"),d=v=>rr(v,"data:"),m=v=>{var w;return((w=v.data)===null||w===void 0?void 0:w.paste)===!0};s.parser.addNodeFilter("img",(v,w,$)=>{if(!Fb(s)&&m($))for(const B of v){const H=B.attr("src");j(H)&&!B.attr("data-mce-object")&&H!==Mn.transparentSrc&&(l(H)||!Vb(s)&&d(H))&&B.remove()}})},bP=(s,l,d)=>{cz(s,l,d),HI(s)},QI=(s,l)=>{l.get()==="text"?(l.set("html"),TC(s,!1)):(l.set("text"),TC(s,!0)),s.focus()},uz=(s,l)=>{s.addCommand("mceTogglePlainTextPaste",()=>{QI(s,l)}),s.addCommand("mceInsertClipboardContent",(d,m)=>{m.html&&Jx(s,m.html,m.internal,!1),m.text&&A0(s,m.text,!1)})},dz=(s,l,d)=>{if(s)try{return s.clearData(),s.setData("text/html",l),s.setData("text/plain",d),s.setData(Yx(),l),!0}catch{return!1}else return!1},VI=(s,l,d,m)=>{dz(s.clipboardData,l.html,l.text)?(s.preventDefault(),m()):d(l.html,m)},vP=s=>(l,d)=>{const{dom:m,selection:v}=s,w=m.create("div",{contenteditable:"false","data-mce-bogus":"all"}),$=m.create("div",{contenteditable:"true"},l);m.setStyles(w,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),w.appendChild($),m.add(s.getBody(),w);const B=v.getRng();$.focus();const H=m.createRng();H.selectNodeContents($),v.setRng(H),Uf.setEditorTimeout(s,()=>{v.setRng(B),m.remove(w),d()},0)},tE=s=>({html:VV(s.selection.getContent({contextual:!0})),text:s.selection.getContent({format:"text"})}),fz=s=>!!s.dom.getParent(s.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",s.getBody()),OP=s=>!s.selection.isCollapsed()||fz(s),zI=s=>l=>{!l.isDefaultPrevented()&&OP(s)&&s.selection.isEditable()&&VI(l,tE(s),vP(s),()=>{if(Mn.browser.isChromium()||Mn.browser.isFirefox()){const d=s.selection.getRng();Uf.setEditorTimeout(s,()=>{s.selection.setRng(d),s.execCommand("Delete")},0)}else s.execCommand("Delete")})},hz=s=>l=>{!l.isDefaultPrevented()&&OP(s)&&VI(l,tE(s),vP(s),St)},WI=s=>{s.on("cut",zI(s)),s.on("copy",hz(s))},ZI=(s,l)=>{var d,m;return ke.getC
`}),s.dom.addStyle(H)}const $=Promise.all(OW(s,m,d)).then(w).catch(w),B=Nb(s);return B&&mW(s,B),$},yW=s=>{const l=s.getDoc(),d=s.getBody();Fg(s),Mw(s)||(l.body.spellcheck=!1,mE.setAttrib(d,"spellcheck","false")),s.quirks=hW(s),tT(s);const m=Cw(s);m!==void 0&&(d.dir=m);const v=my(s);v&&s.on("BeforeSetContent",w=>{cn.each(v,$=>{w.content=w.content.replace($,B=>"<!--mce:protected "+escape(B)+"-->")})}),s.on("SetContent",()=>{s.addVisual(s.getBody())}),s.on("compositionstart compositionend",w=>{s.composing=w.type==="compositionstart"})},_W=s=>{Y1(s)||s.load({initial:!0,format:"html"}),s.startContent=s.getContent({format:"raw"})},RP=s=>{s.removed!==!0&&(_W(s),vW(s))},wW=s=>{let l=!1;const d=setTimeout(()=>{l||s.setProgressState(!0)},500);return()=>{clearTimeout(d),l=!0,s.setProgressState(!1)}},VB=s=>{const l=s.getElement();let d=s.getDoc();s.inline&&(mE.addClass(l,"mce-content-body"),s.contentDocument=d=document,s.contentWindow=window,s.bodyElement=l,s.contentAreaContainer=l);const m=s.getBody();m.disabled=!0,s.readonly=$1(s),s._editableRoot=td(s),!s.readonly&&s.hasEditableRoot()&&(s.inline&&mE.getStyle(m,"position",!0)==="static"&&(m.style.position="relative"),m.contentEditable="true"),m.disabled=!1,s.editorUpload=Z8(s),s.schema=Df(HB(s)),s.dom=Jr(d,{keep_values:!0,url_converter:s.convertURL,url_converter_scope:s,update_styles:!0,root_element:s.inline?s.getBody():null,collect:s.inline,schema:s.schema,contentCssCors:Rh(s),referrerPolicy:fs(s),onSetAttrib:$=>{s.dispatch("SetAttrib",$)},force_hex_color:Dg(s)}),s.parser=gW(s),s.serializer=gM(pW(s),s),s.selection=b0(s.dom,s.getWin(),s.serializer,s),s.annotator=iS(s),s.formatter=E3(s),s.undoManager=T3(s),s._nodeChangeDispatcher=new vI(s),s._selectionOverrides=Jz(s),dH(s),Cz(s),RU(s),Y1(s)||(tB(s),fW(s));const v=PV(s);vO(s,v),pH(s),Im(s),_z(s);const w=HF(s);yW(s),w.fold(()=>{const $=wW(s);QB(s).then(()=>{RP(s),$()})},$=>{s.setProgressState(!0),QB(s).then(()=>{$().then(B=>{s.setProgressState(!1),RP(s),b3(s)},B=>{s.notificationManager.open({type:"error",text:String(B)}),RP(s),b3(s)})})})},zB=mt,SW=(s,l,d)=>jm(s,l,zB,d),gE=Jr.DOM,CW=(s,l,d,m)=>{const v=qe.fromTag("iframe");return m.each(w=>Sr(v,"tabindex",w)),$c(v,d),$c(v,{id:s+"_ifr",frameBorder:"0",allowTransparency:"true",title:l}),Ou(v,"tox-edit-area__iframe"),v},kW=s=>{let l=fv(s)+"<html><head>";Pu(s)!==s.documentBaseUrl&&(l+='<base href="'+s.documentBaseURI.getURI()+'" />'),l+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const d=Rb(s),m=bw(s),v=s.translate(Pw(s));return vi(s)&&(l+='<meta http-equiv="Content-Security-Policy" content="'+vi(s)+'" />'),l+=`</head><body id="${d}" class="mce-content-body ${m}" data-id="${s.id}" aria-label="${v}"><br></body></html>`,l},WB=(s,l)=>{const d=s.translate("Rich Text Area"),m=aa(qe.fromDom(s.getElement()),"tabindex").bind(Gc),v=CW(s.id,d,cr(s),m).dom;v.onload=()=>{v.onload=null,s.dispatch("load")},s.contentAreaContainer=l.iframeContainer,s.iframeElement=v,s.iframeHTML=kW(s),gE.add(l.iframeContainer,v)},F2=s=>{const l=s.iframeElement,d=()=>{s.contentDocument=l.contentDocument,VB(s)};if(Fw(s)||Mn.browser.isFirefox()){const m=s.getDoc();m.open(),m.write(s.iframeHTML),m.close(),d()}else{const m=SW(qe.fromDom(l),"load",()=>{m.unbind(),d()});l.srcdoc=s.iframeHTML}},xW=(s,l)=>{WB(s,l),l.editorContainer&&(l.editorContainer.style.display=s.orgDisplay,s.hidden=gE.isHidden(l.editorContainer)),s.getElement().style.display="none",gE.setAttrib(s.id,"aria-hidden","true"),s.getElement().style.visibility=s.orgVisibility,F2(s)},MP=Jr.DOM,EW=(s,l,d)=>{const m=hO.get(d),v=hO.urls[d]||s.documentBaseUrl.replace(/\/$/,"");if(d=cn.trim(d),m&&cn.inArray(l,d)===-1){if(s.plugins[d])return;try{const w=m(s,v)||{};s.plugins[d]=w,Oe(w.init)&&(w.init(s,v),l.push(d))}catch(w){TM(s,d,w)}}},TW=s=>s.replace(/^\-/,""),AW=s=>{const l=[];Ne(P1(s),d=>{EW(s,l,TW(d))})},$W=s=>{const l=cn.trim(mv(s)),d=s.ui.registry.getAll().icons,m={...n2.get("default").icons,...n2.get(l).icons};nn(m,(v,w)=>{an(d,w)||s.ui.registry.addIcon(w,v)})},ZB=s=>{const l=Eg(s);if(j(l)){const d=G1.get(l);s.theme=d(s,G1.urls[l])||{},O
2024-08-22 17:59:06 +03:00
Actual: `+Nn.join(","));if(!po(T,Yt=>Le(Nn,Yt)))throw new Error("Not all branches were specified when using match. Specified: "+Nn.join(", ")+`
2024-08-23 18:15:18 +03:00
Required: `+T.join(", "));return ln[pe].apply(null,Ie)},log:ln=>{console.log(ln,{constructors:T,constructor:pe,params:Ie})}}}}),M}},wg={...du.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},KO=(_,T)=>_.length===0?wg.none():_.length===1?wg.only(0):T===0?wg.left(0,1):T===_.length-1?wg.right(T-1,T):T>0&&T<_.length-1?wg.middle(T-1,T,T+1):wg.none(),fw=(_,T,M,L,Y)=>{const oe=_.slice(0),pe=KO(_,T),ke=j(Rt(oe,j(0))),Ie=Nn=>L.singleColumnWidth(oe[Nn],M),et=(Nn,Pn)=>Y.calcLeftEdgeDeltas(oe,Nn,Pn,M,L.minCellWidth(),L.isRelative),vt=(Nn,Pn,Yt)=>Y.calcMiddleDeltas(oe,Nn,Pn,Yt,M,L.minCellWidth(),L.isRelative),ln=(Nn,Pn)=>Y.calcRightEdgeDeltas(oe,Nn,Pn,M,L.minCellWidth(),L.isRelative);return pe.fold(ke,Ie,et,vt,ln)},y1=(_,T,M)=>{let L=0;for(let Y=_;Y<T;Y++)L+=M[Y]!==void 0?M[Y]:0;return L},bm=(_,T)=>{const M=xe.justCells(_);return Rt(M,L=>{const Y=y1(L.column,L.column+L.colspan,T);return{element:L.element,width:Y,colspan:L.colspan}})},xb=(_,T)=>{const M=xe.justColumns(_);return Rt(M,(L,Y)=>({element:L.element,width:T[Y],colspan:L.colspan}))},Ps=(_,T)=>{const M=xe.justCells(_);return Rt(M,L=>{const Y=y1(L.row,L.row+L.rowspan,T);return{element:L.element,height:Y,rowspan:L.rowspan}})},fu=(_,T)=>Rt(_.all,(M,L)=>({element:M.element,height:T[L]})),df=_=>rn(_,(T,M)=>T+M,0),Sg=(_,T)=>xe.hasColumns(_)?xb(_,T):bm(_,T),Er=(_,T,M)=>{const L=Sg(_,T);Ue(L,Y=>{M.setElementWidth(Y.element,Y.width)})},Cg=(_,T,M,L,Y)=>{const oe=xe.fromTable(_),pe=Y.getCellDelta(T),ke=Y.getWidths(oe,Y),Ie=M===oe.grid.columns-1,et=L.clampTableDelta(ke,M,pe,Y.minCellWidth(),Ie),vt=fw(ke,M,et,Y,L),ln=Rt(vt,(Nn,Pn)=>Nn+ke[Pn]);Er(oe,ln,Y),L.resizeTable(Y.adjustTableWidth,et,Ie)},Eb=(_,T,M,L)=>{const Y=xe.fromTable(_),oe=_t(Y,_,L),pe=Rt(oe,(vt,ln)=>M===ln?Math.max(T+vt,hc()):vt),ke=Ps(Y,pe),Ie=fu(Y,pe);Ue(Ie,vt=>{of(vt.element,vt.height)}),Ue(ke,vt=>{of(vt.element,vt.height)});const et=df(pe);of(_,et)},wa=(_,T,M,L,Y)=>{const oe=xe.generate(T),pe=L.getWidths(oe,L),ke=L.pixelWidth(),{newSizes:Ie,delta:et}=Y.calcRedestributedWidths(pe,ke,M.pixelDelta,L.isRelative);Er(oe,Ie,L),L.adjustTableWidth(et)},ff=(_,T,M,L)=>{const Y=xe.generate(T),oe=L.getWidths(Y,L);Er(Y,oe,L)},$h=_=>Fe(_,(M,L)=>je(M,oe=>oe.column===L.column)?M:M.concat([L]),[]).sort((M,L)=>M.column-L.column),Tb=mr("col"),_1=mr("colgroup"),w1=_=>Ft(_)==="tr"||_1(_),tv=_=>{const T=Sr(_,"colspan",1),M=Sr(_,"rowspan",1);return{element:_,colspan:T,rowspan:M}},Ab=(_,T=tv)=>{const M=ke=>Tb(ke.element)?_.col(ke):_.cell(ke),L=ke=>_1(ke.element)?_.colgroup(ke):_.row(ke),Y=ke=>{if(w1(ke))return L({element:ke});{const Ie=ke,et=M(T(Ie));return oe=Oe.some({item:Ie,replacement:et}),et}};let oe=Oe.none();return{getOrInit:(ke,Ie)=>oe.fold(()=>Y(ke),et=>Ie(ke,et.item)?et.replacement:Y(ke))}},ed=_=>T=>{const M=[],L=(pe,ke)=>de(M,Ie=>ke(Ie.item,pe)),Y=pe=>{const ke=_==="td"?{scope:null}:{},Ie=T.replace(pe,_,ke);return M.push({item:pe,sub:Ie}),Ie};return{replaceOrInit:(pe,ke)=>{if(w1(pe)||Tb(pe))return pe;{const Ie=pe;return L(Ie,ke).fold(()=>Y(Ie),et=>ke(pe,et.item)?et.sub:Y(Ie))}}}},Nd=_=>Ge(_,"scope").map(T=>T.substr(0,3)),Dt={modification:Ab,transform:ed,merging:_=>({unmerge:L=>{const Y=Nd(L);return Y.each(oe=>pr(L,"scope",oe)),()=>{const oe=_.cell({element:L,colspan:1,rowspan:1});return fc(oe,"width"),fc(L,"width"),Y.each(pe=>pr(oe,"scope",pe)),oe}},merge:L=>{const Y=()=>{const oe=Nr(Rt(L,Nd));if(oe.length===0)return Oe.none();{const pe=oe[0],ke=["row","col"];return je(oe,et=>et!==pe&&Le(ke,et))?Oe.none():Oe.from(pe)}};return fc(L[0],"width"),Y().fold(()=>Xe(L[0],"scope"),oe=>pr(L[0],"scope",oe+"group")),j(L[0])}})},hp=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],mp=(_,T)=>{const M=_.property().name(T);return Le(["ol","ul"],M)},Au=(_,T)=>{const M=_.property().name(T);return Le(hp,M)},nv=(_,T)=>Le(["br","img","hr","input"],_.property().name(T)),bi=qt(),$b=_=>Au(bi,_),Ph=_=>mp(bi,_),ov=_=>nv(bi
2024-08-22 17:59:06 +03:00
`+g.getErrorInfo())},X=(a,f)=>Kr.serror([{path:a,getErrorInfo:f}]),re=(a,f,g)=>X(a,()=>'Could not find valid *required* value for "'+f+'" in '+jm(g)),ye=(a,f)=>X(a,()=>'Choice schema did not contain choice key: "'+f+'"'),Ze=(a,f,g)=>X(a,()=>'The chosen schema: "'+g+'" did not exist in branches: '+jm(f)),tt=(a,f)=>X(a,()=>"There are unsupported fields: ["+f.join(", ")+"] specified"),tn=(a,f)=>X(a,ne(f)),Kn=a=>{const f=(O,x)=>Kr.bindError(a(x),P=>tn(O,P)),g=ne("val");return{extract:f,toString:g}},Mo=Kn(Kr.svalue),To=(a,f,g,O)=>nn(f,g).fold(()=>re(a,g,f),O),_o=(a,f,g,O)=>{const x=nn(a,f).getOrThunk(()=>g(a));return O(x)},ai=(a,f,g)=>g(nn(a,f)),pi=(a,f,g,O)=>{const x=nn(a,f).map(P=>P===!0?g(a):P);return O(x)},Yl=(a,f,g,O,x)=>{const P=Q=>x.extract(f.concat([O]),Q),I=Q=>Q.fold(()=>Kr.svalue(q.none()),U=>{const ee=x.extract(f.concat([O]),U);return Kr.map(ee,q.some)});switch(a.tag){case"required":return To(f,g,O,P);case"defaultedThunk":return _o(g,O,a.process,P);case"option":return ai(g,O,I);case"defaultedOptionThunk":return pi(g,O,a.process,I);case"mergeWithThunk":return _o(g,O,ne({}),Q=>{const U=lr(a.process(g),Q);return P(U)})}},Uu=(a,f,g)=>{const O={},x=[];for(const P of g)_u(P,(I,Q,U,ee)=>{const se=Yl(U,a,f,I,ee);Kr.fold(se,he=>{x.push(...he)},he=>{O[Q]=he})},(I,Q)=>{O[I]=Q(f)});return x.length>0?Kr.serror(x):Kr.svalue(O)},Fa=a=>({extract:(O,x)=>a().extract(O,x),toString:()=>a().toString()}),F0=a=>Ts(ws(a,V)),Hr=a=>{const f=Jn(a),g=Yn(a,(x,P)=>_u(P,I=>lr(x,{[I]:!0}),ne(x)),{});return{extract:(x,P)=>{const I=R(P)?[]:F0(P),Q=jn(I,U=>!Xr(g,U));return Q.length===0?f.extract(x,P):tt(x,Q)},toString:f.toString}},Jn=a=>({extract:(O,x)=>Uu(O,x,a),toString:()=>`obj{
`+Fe(a,x=>_u(x,(P,I,Q,U)=>P+" -> "+U.toString(),(P,I)=>"state("+P+")")).join(`
`)+"}"}),yd=a=>({extract:(O,x)=>{const P=Fe(x,(I,Q)=>a.extract(O.concat(["["+Q+"]"]),I));return im.consolidateArr(P)},toString:()=>"array("+a.toString()+")"}),Zn=(a,f)=>{const g=f!==void 0?f:Se;return{extract:(P,I)=>{const Q=[];for(const U of a){const ee=U.extract(P,I);if(ee.stype===Il.Value)return{stype:Il.Value,svalue:g(ee.svalue)};Q.push(ee)}return im.consolidateArr(Q)},toString:()=>"oneOf("+Fe(a,P=>P.toString()).join(", ")+")"}},Ha=(a,f)=>{const g=(P,I)=>yd(Kn(a)).extract(P,I);return{extract:(P,I)=>{const Q=Ts(I),U=g(P,Q);return Kr.bind(U,ee=>{const se=Fe(ee,he=>xi(he,he,$s(),f));return Jn(se).extract(P,I)})},toString:()=>"setOf("+f.toString()+")"}},sb=(a,f)=>{const g=ri(f);return{extract:(P,I)=>g().extract(P,I),toString:()=>g().toString()}},_d=fe(yd,Jn),ea=ne(Mo),tf=(a,f)=>Kn(g=>{const O=typeof g;return a(g)?Kr.svalue(g):Kr.serror(`Expected type: ${f} but got: ${O}`)}),Ym=tf(J,"number"),Ta=tf(p,"string"),Su=tf(R,"boolean"),Xp=tf(W,"function"),wd=a=>{if(Object(a)!==a)return!0;switch({}.toString.call(a).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(a).every(f=>wd(a[f]));default:return!1}},jp=Kn(a=>wd(a)?Kr.svalue(a):Kr.serror("Expected value to be acceptable for sending via postMessage")),nf=(a,f,g,O)=>nn(g,O).fold(()=>Ze(a,g,O),P=>P.extract(a.concat(["branch: "+O]),f)),un=(a,f)=>({extract:(x,P)=>nn(P,a).fold(()=>ye(x,a),Q=>nf(x,P,f,Q)),toString:()=>"chooseOn("+a+"). Possible values: "+Ts(f)}),rb=()=>yd(Mo),of=a=>Kn(f=>a(f).fold(Kr.serror,Kr.svalue)),sf=(a,f)=>Ha(g=>Kr.fromResult(a(g)),f),ru=(a,f,g)=>{const O=f.extract([a],g);return Kr.mapError(O,x=>({input:g,errors:x}))},li=(a,f,g)=>Kr.toResult(ru(a,f,g)),Js=a=>a.fold(f=>{throw new Error(wl(f))},Se),Ei=(a,f,g)=>Js(li(a,f,g)),wl=a=>`Errors:
`+su(a.errors).join(`
`)+`
2024-08-23 18:15:18 +03:00
Input object: `+jm(a.input),ys=(a,f)=>un(a,ms(f,Jn)),lh=(a,f)=>sb(a,f),ca=xi,Qr=Bl,Gm=a=>of(f=>ct(a,f)?Zo.value(f):Zo.error(`Unsupported value: "${f}", choose one of "${a.join(", ")}".`)),Gt=a=>ca(a,a,$s(),ea()),Sl=(a,f)=>ca(a,a,$s(),f),Km=a=>Sl(a,Ym),Fs=a=>Sl(a,Ta),Li=(a,f)=>ca(a,a,$s(),Gm(f)),Yp=a=>Sl(a,Su),Cu=a=>Sl(a,Xp),ku=(a,f)=>ca(a,a,wu(),Kn(g=>Kr.serror("The field: "+a+" is forbidden. "+f))),Ic=(a,f)=>ca(a,a,$s(),Jn(f)),am=(a,f)=>ca(a,a,$s(),_d(f)),tl=(a,f)=>ca(a,a,$s(),yd(f)),er=a=>ca(a,a,wu(),ea()),ua=(a,f)=>ca(a,a,wu(),f),rf=a=>ua(a,Ym),nl=a=>ua(a,Ta),c1=(a,f)=>ua(a,Gm(f)),ch=a=>ua(a,Xp),af=(a,f)=>ua(a,yd(f)),Ll=(a,f)=>ua(a,Jn(f)),xu=(a,f)=>ua(a,Hr(f)),_t=(a,f)=>ca(a,a,Mc(f),ea()),Gl=(a,f,g)=>ca(a,a,Mc(f),g),iu=(a,f)=>Gl(a,f,Ym),Fl=(a,f)=>Gl(a,f,Ta),Kl=(a,f,g)=>Gl(a,f,Gm(g)),ya=(a,f)=>Gl(a,f,Su),da=(a,f)=>Gl(a,f,Xp),u1=(a,f)=>Gl(a,f,jp),Jl=(a,f,g)=>Gl(a,f,yd(g)),Sd=(a,f,g)=>Gl(a,f,Jn(g)),bo=a=>{let f=a;return{get:()=>f,set:x=>{f=x}}},K={generate:a=>{if(!k(a))throw new Error("cases must be an array");if(a.length===0)throw new Error("there must be at least one case");const f=[],g={};return mt(a,(O,x)=>{const P=Ts(O);if(P.length!==1)throw new Error("one and only one name per case");const I=P[0],Q=O[I];if(g[I]!==void 0)throw new Error("duplicate key detected:"+I);if(I==="cata")throw new Error("cannot have a case named cata (sorry)");if(!k(Q))throw new Error("case arguments must be an array");f.push(I),g[I]=(...U)=>{const ee=U.length;if(ee!==Q.length)throw new Error("Wrong number of arguments to case "+I+". Expected "+Q.length+" ("+Q+"), got "+ee);return{fold:(...he)=>{if(he.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+he.length);return he[x].apply(null,U)},match:he=>{const be=Ts(he);if(f.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+f.join(",")+`
Actual: `+be.join(","));if(!Nt(f,Re=>ct(be,Re)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+`
Required: `+f.join(", "));return he[I].apply(null,U)},log:he=>{console.log(he,{constructors:f,constructor:I,params:U})}}}}),g}};K.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ve=a=>{const f=[],g=[];return mt(a,O=>{O.fold(x=>{f.push(x)},x=>{g.push(x)})}),{errors:f,values:g}},Ae=(a,f)=>{const g={};return vs(a,(O,x)=>{ct(f,x)||(g[x]=O)}),g},ot=(a,f)=>({[a]:f}),Vt=a=>{const f={};return mt(a,g=>{f[g.key]=g.value}),f},gn=(a,f)=>Ae(a,f),xn=(a,f)=>ot(a,f),ao=a=>Vt(a),Uo=(a,f)=>a.length===0?Zo.value(f):Zo.value(lr(f,ou.apply(void 0,a))),_i=a=>Zo.error(pt(a)),tr=(a,f)=>{const g=ve(a);return g.errors.length>0?_i(g.errors):Uo(g.values,f)},Vr=a=>W(a)?a:Tt,gc=(a,f,g)=>{let O=a.dom;const x=Vr(g);for(;O.parentNode;){O=O.parentNode;const P=nt.fromDom(O),I=f(P);if(I.isSome())return I;if(x(P))break}return q.none()},Cl=(a,f,g)=>{const O=f(a),x=Vr(g);return O.orThunk(()=>x(a)?q.none():gc(a,f,x))},Bc=(a,f)=>Us(a.element,f.event.target),Cd={can:St,abort:Tt,run:j},qu=a=>{if(!Xr(a,"can")&&!Xr(a,"abort")&&!Xr(a,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(a,null,2)+" does not have can, abort, or run!");return{...Cd,...a}},uh=(a,f)=>(...g)=>po(a,(O,x)=>O&&f(x).apply(void 0,g),!0),Xs=(a,f)=>(...g)=>po(a,(O,x)=>O||f(x).apply(void 0,g),!1),dh=a=>W(a)?{can:St,abort:Tt,run:a}:a,Jm=a=>{const f=uh(a,x=>x.can),g=Xs(a,x=>x.abort);return{can:f,abort:g,run:(...x)=>{mt(a,P=>{P.run.apply(void 0,x)})}}},Ti=ne,Lc=Ti("touchstart"),lm=Ti("touchmove"),fh=Ti("touchend"),ds=Ti("touchcancel"),_s=Ti("mousedown"),fa=Ti("mousemove"),ol=Ti("mouseout"),Gp=Ti("mouseup"),kd=Ti("mouseover"),gi=Ti("focusin"),Fc=Ti("focusout"),Eu=Ti("keydown"),hh=Ti("keyup"),Af=Ti("input"),ep=Ti("change"),lf=Ti("click"),NO=Ti("transitioncancel"),mh=Ti("transitionend"),d1=Ti("transitionstart"),ph=Ti("selectstart"),ta=a=>ne("alloy."+a),Xu={tap:ta("tap")},xd=ta("focus"),gh=ta("blur.post"),bh=ta("paste.post"),tp=ta("receive"),au=ta("execute"),Fi=ta("focus.item"),Ed=Xu.tap,ib=ta("longpress"),f1=ta("sandbox.close"),h1=ta("typeahead.cancel"),vh=ta("system.init"),ec=ta("system.touchmove"),ju=ta("system.touchend"),$f=ta("system.scroll"),cf=ta("system.resize"),bc=ta("system.attached"),Yu=ta("system.detached"),Oh=ta("system.dismissRequested"),H0=ta("system.repositionRequested"),ab=ta("focusmanager.shifted"),Kp=ta("slotcontainer.visibility"),yh=ta("system.external.element.scroll"),Jp=ta("change.tab"),lb=ta("dismiss.tab"),eg=ta("highlight"),tg=ta("dehighlight"),gs=(a,f)=>{cm(a,a.element,f,{})},ho=(a,f,g)=>{cm(a,a.element,f,g)},Td=a=>{gs(a,au())},ng=(a,f,g)=>{cm(a,f,g,{})},cm=(a,f,g,O)=>{const x={target:f,...O};a.getSystem().triggerEvent(g,f,x)},tw=(a,f,g,O)=>{const x={...O,target:f};a.getSystem().triggerEvent(g,f,x)},cb=(a,f,g,O)=>{a.getSystem().triggerEvent(g,f,O.event)},kr=a=>ao(a),ub=(a,f)=>({key:a,value:qu({abort:f})}),m1=(a,f)=>({key:a,value:qu({can:f})}),Q0=a=>({key:a,value:qu({run:(f,g)=>{g.event.prevent()}})}),qt=(a,f)=>({key:a,value:qu({run:f})}),Ad=(a,f,g)=>({key:a,value:qu({run:(O,x)=>{f.apply(void 0,[O,x].concat(g))}})}),IO=a=>f=>qt(a,f),og=a=>f=>({key:a,value:qu({run:(g,O)=>{Bc(g,O)&&f(g,O)}})}),nw=(a,f)=>qt(a,(g,O)=>{g.getSystem().getByUid(f).each(x=>{cb(x,x.element,a,O)})}),np=(a,f,g)=>{const O=f.partUids[g];return nw(a,O)},V0=(a,f)=>qt(a,(g,O)=>{const x=O.event,P=g.getSystem().getByDom(x.target).getOrThunk(()=>Cl(x.target,Q=>g.getSystem().getByDom(Q).toOptional(),Tt).getOr(g));f(g,P,O)}),_h=a=>qt(a,(f,g)=>{g.cut()}),wh=a=>qt(a,(f,g)=>{g.stop()}),$d=(a,f)=>og(a)(f),xr=og(bc()),Pd=og(Yu()),sg=og(vh()),vc=IO(au()),ls=(a,f)=>{const O=(f||document).createElement("div");return O.innerHTML=a,Ya(nt.fromDom(O))},rg=a=>a.dom.innerHTML,Sh=(a,f)=>{const O=zi(a).dom,x=nt.fromDom(O.createDocumentFragment()),P=ls(f,O);nu(x,P),Dr(a),la(a,x)},um=a=>{const f=nt.fromTag("div"),g=nt.fromDom(a.dom.cloneNode(!0));return la(f,g),rg(f)},db=(a,f)=>nt.fromDom(a.dom.cloneNode(f)),p1=a=>db(a,!1),BO=a=>db(a,!0),tc=a=>{if(Ee(a))return"#shadow-root";{const f=p1(a);return um(f)}},Pf=a=>tc(a),eC=(a
2024-08-22 17:59:06 +03:00
Originator: `+Pf(O)+`
Target: `+Pf(x)+`
Check the `+xd()+" event handlers"),!1):!0})]);var op=Object.freeze({__proto__:null,events:fb});let gl=0;const Vn=a=>{const g=new Date().getTime(),O=Math.floor(Math.random()*1e9);return gl++,a+"_"+O+gl+String(g)},ow=ne("alloy-id-"),z0=ne("data-alloy-id"),Ch=ow(),Hc=z0(),kh=(a,f)=>{const g=Vn(Ch+a);return ig(f,g),g},ig=(a,f)=>{Object.defineProperty(a.dom,Hc,{value:f,writable:!0})},sp=a=>{const f=Ls(a)?a.dom[Hc]:null;return q.from(f)},ag=a=>Vn(a),hb=Se,Gu=a=>{const f=x=>`The component must be in a context to execute: ${x}`+(a?`
2024-08-23 18:15:18 +03:00
`+Pf(a().element)+" is not in context.":""),g=x=>()=>{throw new Error(f(x))},O=x=>()=>{console.warn(f(x))};return{debugInfo:ne("fake"),triggerEvent:O("triggerEvent"),triggerFocus:O("triggerFocus"),triggerEscape:O("triggerEscape"),broadcast:O("broadcast"),broadcastOn:O("broadcastOn"),broadcastEvent:O("broadcastEvent"),build:g("build"),buildOrPatch:g("buildOrPatch"),addToWorld:g("addToWorld"),removeFromWorld:g("removeFromWorld"),addToGui:g("addToGui"),removeFromGui:g("removeFromGui"),getByUid:g("getByUid"),getByDom:g("getByDom"),isConnected:Tt}},Dd=Gu(),lg=(a,f,g)=>{const O=g.toString(),x=O.indexOf(")")+1,P=O.indexOf("("),I=O.substring(P+1,x-1).split(/,\s*/);return a.toFunctionAnnotation=()=>({name:f,parameters:Ku(I.slice(0,1).concat(I.slice(3)))}),a},Ku=a=>Fe(a,f=>Di(f,"/*")?f.substring(0,f.length-2):f),mb=(a,f)=>{const g=a.toString(),O=g.indexOf(")")+1,x=g.indexOf("("),P=g.substring(x+1,O-1).split(/,\s*/);return a.toFunctionAnnotation=()=>({name:f,parameters:Ku(P)}),a},LO=(a,f)=>{const g=f.toString(),O=g.indexOf(")")+1,x=g.indexOf("("),P=g.substring(x+1,O-1).split(/,\s*/);return a.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Ku(P.slice(1))}),a},cg=Vn("alloy-premade"),Df=a=>(Object.defineProperty(a.element.dom,cg,{value:a.uid,writable:!0}),xn(cg,a)),FO=a=>ns(a.dom,cg),ug=a=>nn(a,cg),xh=a=>LO((f,...g)=>a(f.getApis(),f,...g),a),Ju={init:()=>Hl({readState:ne("No State required")})},Hl=a=>a,W0=(a,f)=>{const g=Fe(f,x=>Ll(x.name(),[Gt("config"),_t("state",Ju)])),O=li("component.behaviours",Jn(g),a.behaviours).fold(x=>{throw new Error(wl(x)+`
2024-08-22 17:59:06 +03:00
Complete spec:
`+JSON.stringify(a,null,2))},Se);return{list:f,data:ms(O,x=>{const P=x.map(I=>({config:I.config,state:I.state.init(I.config)}));return ne(P)})}},Z0=a=>a.list,U0=a=>a.data,dg=(a,f)=>{const g={};return vs(a,(O,x)=>{vs(O,(P,I)=>{const Q=nn(g,I).getOr([]);g[I]=Q.concat([f(x,P)])})}),g},Qc=a=>({classes:N(a.classes)?[]:a.classes,attributes:N(a.attributes)?{}:a.attributes,styles:N(a.styles)?{}:a.styles}),lu=(a,f)=>({...a,attributes:{...a.attributes,...f.attributes},styles:{...a.styles,...f.styles},classes:a.classes.concat(f.classes)}),Rf=(a,f,g,O)=>{const x={...f};mt(g,se=>{x[se.name()]=se.exhibit(a,O)});const P=dg(x,(se,he)=>({name:se,modification:he})),I=se=>Yn(se,(he,be)=>({...be.modification,...he}),{}),Q=Yn(P.classes,(se,he)=>he.modification.concat(se),[]),U=I(P.attributes),ee=I(P.styles);return Qc({classes:Q,attributes:U,styles:ee})},pb=(a,f,g,O)=>{try{const x=is(g,(P,I)=>{const Q=P[f],U=I[f],ee=O.indexOf(Q),se=O.indexOf(U);if(ee===-1)throw new Error("The ordering for "+a+" does not have an entry for "+Q+`.
Order specified: `+JSON.stringify(O,null,2));if(se===-1)throw new Error("The ordering for "+a+" does not have an entry for "+U+`.
2024-08-23 18:15:18 +03:00
Order specified: `+JSON.stringify(O,null,2));return ee<se?-1:se<ee?1:0});return Zo.value(x)}catch(x){return Zo.error([x])}},HO=(a,f)=>({handler:a,purpose:f}),QO=(a,f)=>({cHandler:a,purpose:f}),q0=(a,f)=>QO(Be.apply(void 0,[a.handler].concat(f)),a.purpose),fg=a=>a.cHandler,hg=(a,f)=>({name:a,handler:f}),gb=(a,f)=>{const g={};return mt(a,O=>{g[O.name()]=O.handlers(f)}),g},sw=(a,f,g)=>{const O={...g,...gb(f,a)};return dg(O,hg)},bb=(a,f,g,O)=>{const x=sw(a,g,O);return X0(x,f)},mg=a=>{const f=dh(a);return(g,O,...x)=>{const P=[g,O].concat(x);f.abort.apply(void 0,P)?O.stop():f.can.apply(void 0,P)&&f.run.apply(void 0,P)}},rw=(a,f)=>Zo.error(["The event ("+a+`) has more than one behaviour that listens to it.
2024-08-22 17:59:06 +03:00
When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).
2024-08-23 18:15:18 +03:00
The behaviours that can trigger it are: `+JSON.stringify(Fe(f,g=>g.name),null,2)]),g1=(a,f,g)=>{const O=f[g];return O?pb("Event: "+g,"name",a,O).map(x=>{const P=Fe(x,I=>I.handler);return Jm(P)}):rw(g,a)},X0=(a,f)=>{const g=Pi(a,(O,x)=>(O.length===1?Zo.value(O[0].handler):g1(O,f,x)).map(I=>{const Q=mg(I),U=O.length>1?jn(f[x],ee=>dn(O,se=>se.name===ee)).join(" > "):O[0].name;return xn(x,HO(Q,U))}));return tr(g,{})},Vc="alloy.base.behaviour",b1=Jn([ca("dom","dom",$s(),Jn([Gt("tag"),_t("styles",{}),_t("classes",[]),_t("attributes",{}),er("value"),er("innerHtml")])),Gt("components"),Gt("uid"),_t("events",{}),_t("apis",{}),ca("eventOrder","eventOrder",Nc({[au()]:["disabling",Vc,"toggling","typeaheadevents"],[xd()]:[Vc,"focusing","keying"],[vh()]:[Vc,"disabling","toggling","representing"],[Af()]:[Vc,"representing","streaming","invalidating"],[Yu()]:[Vc,"representing","item-events","tooltipping"],[_s()]:["focusing",Vc,"item-type-events"],[Lc()]:["focusing",Vc,"item-type-events"],[kd()]:["item-type-events","tooltipping"],[tp()]:["receiving","reflecting","tooltipping"]}),ea()),er("domModification")]),j0=a=>li("custom.definition",b1,a),vb=a=>({...a.dom,uid:a.uid,domChildren:Fe(a.components,f=>f.element)}),tC=a=>a.domModification.fold(()=>Qc({}),Qc),Ob=a=>a.events,Eh=(a,f)=>{const g=ui(a,f);return g===void 0||g===""?[]:g.split(" ")},Mf=(a,f,g)=>{const x=Eh(a,f).concat([g]);return Mn(a,f,x.join(" ")),!0},Y0=(a,f,g)=>{const O=jn(Eh(a,f),x=>x!==g);return O.length>0?Mn(a,f,O.join(" ")):We(a,f),!1},pg=a=>a.dom.classList!==void 0,yb=a=>Eh(a,"class"),VO=(a,f)=>Mf(a,"class",f),Jr=(a,f)=>Y0(a,"class",f),Rd=(a,f)=>ct(yb(a),f)?Jr(a,f):VO(a,f),na=(a,f)=>{pg(a)?a.dom.classList.add(f):VO(a,f)},zO=a=>{(pg(a)?a.dom.classList:yb(a)).length===0&&We(a,"class")},wi=(a,f)=>{pg(a)?a.dom.classList.remove(f):Jr(a,f),zO(a)},rp=(a,f)=>{const g=pg(a)?a.dom.classList.toggle(f):Rd(a,f);return zO(a),g},Aa=(a,f)=>pg(a)&&a.dom.classList.contains(f),Ai=(a,f)=>{mt(f,g=>{na(a,g)})},Tu=(a,f)=>{mt(f,g=>{wi(a,g)})},G0=(a,f)=>{mt(f,g=>{rp(a,g)})},sl=(a,f)=>Nt(f,g=>Aa(a,g)),v1=a=>{const f=a.dom.classList,g=new Array(f.length);for(let O=0;O<f.length;O++){const x=f.item(O);x!==null&&(g[O]=x)}return g},gg=a=>pg(a)?v1(a):yb(a),Nf=a=>a.dom.value,bg=(a,f)=>{if(f===void 0)throw new Error("Value.set was undefined");a.dom.value=f},dm=(a,f,g)=>uc(a,f).map(x=>{if(g.exists(I=>!Us(I,x))){const I=g.map(ia).getOr("span"),Q=nt.fromTag(I);return Ui(x,Q),Q}else return x}),Th=(a,f,g)=>{g.fold(()=>la(a,f),O=>{Us(O,f)||(Ui(O,f),Pc(O))})},iw=(a,f,g)=>{const O=Fe(f,g),x=Ya(a);return mt(x.slice(O.length),Pc),O},WO=(a,f,g,O)=>{const x=uc(a,f),P=O(g,x),I=dm(a,f,x);return Th(a,P.element,I),P},nC=(a,f,g)=>iw(a,f,(O,x)=>WO(a,x,O,g)),oC=(a,f)=>iw(a,f,(g,O)=>{const x=uc(a,O);return Th(a,g,x),g}),Md=(a,f)=>{const g=Ts(a),O=Ts(f),x=xt(O,g),P=Gs(a,(I,Q)=>!ns(f,Q)||I!==f[Q]).t;return{toRemove:x,toSet:P}},nc=(a,f)=>{const{class:g,style:O,...x}=Pt(f),{toSet:P,toRemove:I}=Md(a.attributes,x),Q=()=>{mt(I,Ot=>We(f,Ot)),fd(f,P)},U=yr(f),{toSet:ee,toRemove:se}=Md(a.styles,U),he=()=>{mt(se,Ot=>Jo(f,Ot)),Lr(f,ee)},be=gg(f),we=xt(be,a.classes),Re=xt(a.classes,be),Je=()=>{Ai(f,Re),Tu(f,we)},Ct=Ot=>{Sh(f,Ot)},at=()=>{const Ot=a.domChildren;oC(f,Ot)},st=()=>{const Ot=f,hn=a.value.getOrUndefined();hn!==Nf(Ot)&&bg(Ot,hn??"")};return Q(),Je(),he(),a.innerHtml.fold(at,Ct),st(),f},aw=a=>{const f=nt.fromTag(a.tag);fd(f,a.attributes),Ai(f,a.classes),Lr(f,a.styles),a.innerHtml.each(O=>Sh(f,O));const g=a.domChildren;return nu(f,g),a.value.each(O=>{bg(f,O)}),f},lw=(a,f)=>{try{const g=nc(a,f);return q.some(g)}catch{return q.none()}},fm=a=>a.innerHtml.isSome()&&a.domChildren.length>0,O1=(a,f)=>{const g=x=>ia(x)===a.tag&&!fm(a)&&!FO(x),O=f.filter(g).bind(x=>lw(a,x)).getOrThunk(()=>aw(a));return ig(O,a.uid),O},_b=a=>{const f=nn(a,"behaviours").getOr({});return Ne(Ts(f),g=>{const O=f[g];return V(O)?[O.me]:[]})},wb=(a,f)=>W0(a,f),If=a=>{const f=_b(a);return wb(a,f)},vg=(a,f,g)=>{const O=vb(a),x=tC(a),P={"alloy.base.modification":x},I=f.length>0?Rf(g,P,f,O):x;return lu(O,I)},hm=(a,f,g)=>{const O={"alloy.base.behaviour":Ob(a)};return bb
`);return gt(f,g=>g.indexOf("alloy")>0&&!dn(uw,O=>g.indexOf(O)>-1)).getOr(YO)}else return YO},dw={logEventCut:j,logEventStopped:j,logNoParent:j,logEventNoHandlers:j,logEventResponse:j,write:j},kb=(a,f,g)=>J0(a,f,g),_g=ne(dw),du=ne([Gt("menu"),Gt("selectedMenu")]),GO=ne([Gt("item"),Gt("selectedItem")]);ne(Jn(GO().concat(du())));const wg=ne(Jn(GO())),KO=Ic("initSize",[Gt("numColumns"),Gt("numRows")]),fw=()=>Sl("markers",wg()),y1=()=>Ic("markers",[Gt("backgroundMenu")].concat(du()).concat(GO())),bm=a=>Ic("markers",Fe(a,Gt)),xb=(a,f,g)=>(ev(),ca(f,f,g,of(O=>Zo.value((...x)=>O.apply(void 0,x))))),Ps=a=>xb("onHandler",a,Mc(j)),fu=a=>xb("onKeyboardHandler",a,Mc(q.none)),df=a=>xb("onHandler",a,$s()),Sg=a=>xb("onKeyboardHandler",a,$s()),Er=(a,f)=>Qr(a,ne(f)),Cg=a=>Qr(a,Se),Eb=ne(KO),wa=(a,f,g,O,x,P,I,Q=!1)=>({x:a,y:f,bubble:g,direction:O,placement:x,restriction:P,label:`${I}-${x}`,alwaysFit:Q}),ff=K.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),$h=(a,f,g,O,x,P,I,Q,U)=>a.fold(f,g,O,x,P,I,Q,U),Tb=(a,f,g,O)=>a.fold(f,f,O,O,f,O,g,g),_1=(a,f,g,O)=>a.fold(f,O,f,O,g,g,f,O),w1=ff.southeast,tv=ff.southwest,Ab=ff.northeast,ed=ff.northwest,Nd=ff.south,hw=ff.north,Dt=ff.east,hp=ff.west,mp=(a,f,g,O)=>{const x=a+f;return x>O?g:x<g?O:x},Au=(a,f,g)=>Math.min(Math.max(a,f),g),nv=(a,f)=>{switch(f){case 1:return a.x;case 0:return a.x+a.width;case 2:return a.y;case 3:return a.y+a.height}},bi=(a,f)=>kn(["left","right","top","bottom"],g=>nn(f,g).map(O=>nv(a,O))),$b=(a,f,g)=>{const O=(U,ee)=>f[U].map(se=>{const he=U==="top"||U==="bottom",be=he?g.top:g.left,Re=(U==="left"||U==="top"?Math.max:Math.min)(se,ee)+be;return he?Au(Re,a.y,a.bottom):Au(Re,a.x,a.right)}).getOr(ee),x=O("left",a.x),P=O("top",a.y),I=O("right",a.right),Q=O("bottom",a.bottom);return Cr(x,P,I-x,Q-P)},Ph="layout",ov=a=>a.x,Pb=(a,f)=>a.x+a.width/2-f.width/2,sv=(a,f)=>a.x+a.width-f.width,S1=(a,f)=>a.y-f.height,kg=a=>a.y+a.height,rv=(a,f)=>a.y+a.height/2-f.height/2,mw=a=>a.x+a.width,sa=(a,f)=>a.x-f.width,Qa=(a,f,g)=>wa(ov(a),kg(a),g.southeast(),w1(),"southeast",bi(a,{left:1,top:3}),Ph),kl=(a,f,g)=>wa(sv(a,f),kg(a),g.southwest(),tv(),"southwest",bi(a,{right:0,top:3}),Ph),Va=(a,f,g)=>wa(ov(a),S1(a,f),g.northeast(),Ab(),"northeast",bi(a,{left:1,bottom:2}),Ph),os=(a,f,g)=>wa(sv(a,f),S1(a,f),g.northwest(),ed(),"northwest",bi(a,{right:0,bottom:2}),Ph),oc=(a,f,g)=>wa(Pb(a,f),S1(a,f),g.north(),hw(),"north",bi(a,{bottom:2}),Ph),zr=(a,f,g)=>wa(Pb(a,f),kg(a),g.south(),Nd(),"south",bi(a,{top:3}),Ph),za=(a,f,g)=>wa(mw(a),rv(a,f),g.east(),Dt(),"east",bi(a,{left:0}),Ph),C1=(a,f,g)=>wa(sa(a,f),rv(a,f),g.west(),hp(),"west",bi(a,{right:1}),Ph),Bf=()=>[Qa,kl,Va,os,zr,oc,za,C1],k1=()=>[kl,Qa,os,Va,zr,oc,za,C1],iv=()=>[Va,os,Qa,kl,oc,zr],JO=()=>[os,Va,kl,Qa,oc,zr],Db=()=>[Qa,kl,Va,os,zr,oc],av=()=>[kl,Qa,os,Va,zr,oc],lv=(a,f)=>f.universal?a:jn(a,g=>ct(f.channels,g));var Lf=Object.freeze({__proto__:null,events:a=>kr([qt(tp(),(f,g)=>{const O=a.channels,x=Ts(O),P=g,I=lv(x,P);mt(I,Q=>{const U=O[Q],ee=U.schema,se=Ei("channel["+Q+`] data
Receiver: `+Pf(f.element),ee,P.data);U.onReceive(f,se)})})])}),ey=[Sl("channels",sf(Zo.value,Hr([df("onReceive"),_t("schema",ea())])))];const Dh=(a,f,g)=>vc(O=>{g(O,a,f)}),ha=(a,f,g)=>sg((O,x)=>{g(O,a,f)}),Wa=(a,f,g,O,x,P)=>{const I=Hr(a),Q=Ll(f,[xu("config",a)]);return hf(I,Q,f,g,O,x,P)},gw=(a,f,g,O,x,P)=>{const I=a,Q=Ll(f,[ua("config",a)]);return hf(I,Q,f,g,O,x,P)},zc=(a,f,g)=>lg((x,...P)=>{const I=[x].concat(P);return x.config({name:ne(a)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+a+". Using API: "+g)},Q=>{const U=Array.prototype.slice.call(I,1);return f.apply(void 0,[x,Q.config,Q.state].concat(U))})},g,f),sC=a=>({key:a,value:void 0}),hf=(a,f,g,O,x,P,I)=>{const Q=he=>Xr(he,g)?he[g]():q.none(),U=ms(x,(he,be)=>zc(g,he,be)),se={...ms(P,(he,be)=>mb(he,be)),...U,revoke:Be(sC,g),config:he=>{const be=Ei(g+"-config",a,he);return{key:g,value:{config:be,me:se,configAsRaw:ri(()=>Ei(g+"-config",a,he)),initialConfig:he,state:I}}},schema:ne(f),exhibit:(he,be)=>Rn(Q(he),nn(O,"exhibit"),(we,Re)=>Re(be,we.config,we.state)).getOrThunk(()=>Qc({})),name:ne(g),handlers:he=>Q(he).map(be=>nn(O,"events").getOr(()=>({}))(be.config,be.state)).getOr({})};return se},On=a=>ao(a),cv=Hr([Gt("fields"),Gt("name"),_t("active",{}),_t("apis",{}),_t("state",Ju),_t("extra",{})]),Za=a=>{const f=Ei("Creating behaviour: "+a.name,cv,a);return Wa(f.fields,f.name,f.active,f.apis,f.extra,f.state)},uv=Hr([Gt("branchKey"),Gt("branches"),Gt("name"),_t("active",{}),_t("apis",{}),_t("state",Ju),_t("extra",{})]),vm=a=>{const f=Ei("Creating behaviour: "+a.name,uv,a);return gw(ys(f.branchKey,f.branches),f.name,f.active,f.apis,f.extra,f.state)},x1=ne(void 0),Wc=Za({fields:ey,name:"receiving",active:Lf});var E1=Object.freeze({__proto__:null,exhibit:(a,f)=>Qc({classes:[],styles:f.useFixed()?{}:{position:"relative"}})});const ji=(a,f=!1)=>a.dom.focus({preventScroll:f}),mf=a=>a.dom.blur(),T1=a=>{const f=At(a).dom;return a.dom===f.activeElement},Ff=(a=Wu())=>q.from(a.dom.activeElement).map(nt.fromDom),Id=a=>Ff(At(a)).filter(f=>a.dom.contains(f.dom)),Hn=(a,f)=>{const g=At(f),O=Ff(g).bind(P=>{const I=Q=>Us(P,Q);return I(f)?q.some(f):jO(f,I)}),x=a(f);return O.each(P=>{Ff(g).filter(I=>Us(I,P)).fold(()=>{ji(P)},j)}),x},$u=(a,f,g,O,x)=>{const P=I=>I+"px";return{position:a,left:f.map(P),top:g.map(P),right:O.map(P),bottom:x.map(P)}},dv=a=>({...a,position:q.some(a.position)}),Hf=(a,f)=>{cn(a,dv(f))},cr=K.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),fv=(a,f,g,O,x,P)=>{const I=f.rect,Q=I.x-g,U=I.y-O,ee=I.width,se=I.height,he=x-(Q+ee),be=P-(U+se),we=q.some(Q),Re=q.some(U),Je=q.some(he),Ct=q.some(be),at=q.none();return $h(f.direction,()=>$u(a,we,Re,at,at),()=>$u(a,at,Re,Je,at),()=>$u(a,we,at,at,Ct),()=>$u(a,at,at,Je,Ct),()=>$u(a,we,Re,at,at),()=>$u(a,we,at,at,Ct),()=>$u(a,we,Re,at,at),()=>$u(a,at,Re,Je,at))},Pu=(a,f)=>a.fold(()=>{const g=f.rect;return $u("absolute",q.some(g.x),q.some(g.y),q.none(),q.none())},(g,O,x,P)=>fv("absolute",f,g,O,x,P),(g,O,x,P)=>fv("fixed",f,g,O,x,P)),Rb=(a,f)=>{const g=Be(bd,f),O=a.fold(g,g,()=>{const I=el();return bd(f).translate(-I.left,-I.top)}),x=Wi(f),P=hd(f);return Cr(O.left,O.top,x,P)},bw=(a,f)=>f.fold(()=>a.fold(Ea,Ea,Cr),g=>a.fold(ne(g),ne(g),()=>{const O=vi(a,g.x,g.y);return Cr(O.left,O.top,g.width,g.height)})),vi=(a,f,g)=>{const O=Ws(f,g),x=()=>{const P=el();return O.translate(-P.left,-P.top)};return a.fold(ne(O),ne(O),x)},vw=(a,f,g,O)=>a.fold(f,g,O);cr.none;const Vl=cr.relative,Om=cr.fixed,Ow=(a,f)=>({anchorBox:a,origin:f}),yw=(a,f)=>Ow(a,f),hv="data-alloy-placement",_w=(a,f)=>{Mn(a,hv,f)},ny=a=>me(a,hv),oy=a=>We(a,hv),A1=K.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),sy=(a,f)=>{const{x:g,y:O,right:x,bottom:P}=f,{x:I,y:Q,right:U,bottom:ee,width:se,height:he}=a,be=I>=g&&I<=x,we=Q>=O&&Q<=P,Re=be&&we,Je=U<=x&&U>=g,Ct=ee<=P&&ee>=O,at=Je&&Ct,st=Math.min(se,I>=g?x-I:U-g),Ot=Math.min(he,Q>=O?P-Q:ee-O);return{originInBounds:Re,sizeInBounds:at,visibleW:st,visibleH:Ot}},mv=(a,f)=>{const{x:g,y:O,right:x,bottom:P}=f,{x:I,y:Q,widt
2024-08-22 17:59:06 +03:00
Known: [`+Ts(O)+`]
Namespace: `+a.getOr("none")+`
2024-08-23 18:15:18 +03:00
Spec: `+JSON.stringify(g,null,2))},x=>x.replace()),Iy=(a,f,g,O)=>Lh(g)&&g.uiType===My?Ny(a,f,g,O):Fv.single(!1,ne(g)),e0=(a,f,g,O)=>Iy(a,f,g,O).fold((P,I)=>{const Q=Lh(g)?I(f,g.config,g.validated):I(f),U=nn(Q,"components").getOr([]),ee=Ne(U,se=>e0(a,f,se,O));return[{...Q,components:ee}]},(P,I)=>{if(Lh(g)){const Q=I(f,g.config,g.validated);return g.validated.preprocess.getOr(Se)(Q)}else return I(f)}),bC=(a,f,g,O)=>Ne(g,x=>e0(a,f,x,O)),Hv=(a,f)=>{let g=!1;const O=()=>g,x=()=>{if(g)throw new Error("Trying to use the same placeholder more than once: "+a);return g=!0,f},P=()=>f.fold((I,Q)=>I,(I,Q)=>I);return{name:ne(a),required:P,used:O,replace:x}},tS=(a,f,g,O)=>{const x=ms(O,(I,Q)=>Hv(Q,I)),P=bC(a,f,g,x);return vs(x,I=>{if(I.used()===!1&&I.required())throw new Error("Placeholder: "+I.name()+` was not found in components list
2024-08-22 17:59:06 +03:00
Namespace: `+a.getOr("none")+`
2024-08-23 18:15:18 +03:00
Components: `+JSON.stringify(f.components,null,2))}),P},nS=Fv.single,KE=Fv.multiple,Fh=ne(My),By=K.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),t0=_t("factory",{sketch:Se}),ic=_t("schema",[]),qa=Gt("name"),Ly=ca("pname","pname",La(a=>"<alloy."+Vn(a.name)+">"),ea()),Qv=Qr("schema",()=>[er("preprocess")]),Fy=_t("defaults",ne({})),Vv=_t("overrides",ne({})),zv=Jn([t0,ic,qa,Ly,Fy,Vv]),n0=Jn([t0,ic,qa,Fy,Vv]),vC=Jn([t0,ic,qa,Ly,Fy,Vv]),Wv=Jn([t0,Qv,qa,Gt("unit"),Ly,Fy,Vv]),OC=a=>a.fold(q.some,q.none,q.some,q.some),yC=a=>{const f=g=>g.name;return a.fold(f,f,f,f)},_C=a=>a.fold(Se,Se,Se,Se),bf=(a,f)=>g=>{const O=Ei("Converting part type",f,g);return a(O)},yc=bf(By.required,zv),Wf=bf(By.external,n0),Mu=bf(By.optional,vC),Zv=bf(By.group,Wv),Hy=ne("entirety");var wC=Object.freeze({__proto__:null,required:yc,external:Wf,optional:Mu,group:Zv,asNamedPart:OC,name:yC,asCommon:_C,original:Hy});const Uv=(a,f,g,O)=>lr(f.defaults(a,g,O),g,{uid:a.partUids[f.name]},f.overrides(a,g,O)),JE=(a,f,g)=>{const O={},x={};return mt(g,P=>{P.fold(I=>{O[I.pname]=nS(!0,(Q,U,ee)=>I.factory.sketch(Uv(Q,I,U,ee)))},I=>{const Q=f.parts[I.name];x[I.name]=ne(I.factory.sketch(Uv(f,I,Q[Hy()]),Q))},I=>{O[I.pname]=nS(!1,(Q,U,ee)=>I.factory.sketch(Uv(Q,I,U,ee)))},I=>{O[I.pname]=KE(!0,(Q,U,ee)=>{const se=Q[I.name];return Fe(se,he=>I.factory.sketch(lr(I.defaults(Q,he,ee),he,I.overrides(Q,he))))})})}),{internals:ne(O),externals:ne(x)}},wp=(a,f)=>{const g={};return mt(f,O=>{OC(O).each(x=>{const P=qv(a,x.pname);g[x.name]=I=>{const Q=Ei("Part: "+x.name+" in "+a,Jn(x.schema),I);return{...P,config:I,validated:Q}}})}),g},qv=(a,f)=>({uiType:Fh(),owner:a,name:f}),oS=(a,f,g)=>({uiType:Fh(),owner:a,name:f,config:g,validated:{}}),SC=a=>Ne(a,f=>f.fold(q.none,q.some,q.none,q.none).map(g=>Ic(g.name,g.schema.concat([Cg(Hy())]))).toArray()),CC=a=>Fe(a,yC),sS=(a,f,g)=>JE(a,f,g),Qy=(a,f,g)=>tS(q.some(a),f,f.components,g),ti=(a,f,g)=>{const O=f.partUids[g];return a.getSystem().getByUid(O).toOptional()},Sp=(a,f,g)=>ti(a,f,g).getOrDie("Could not find part: "+g),kC=(a,f,g)=>{const O={},x=f.partUids,P=a.getSystem();return mt(g,I=>{O[I]=ne(P.getByUid(x[I]))}),O},rS=(a,f)=>{const g=a.getSystem();return ms(f.partUids,(O,x)=>ne(g.getByUid(O)))},iS=a=>Ts(a.partUids),F1=(a,f,g)=>{const O={},x=f.partUids,P=a.getSystem();return mt(g,I=>{O[I]=ne(P.getByUid(x[I]).getOrDie())}),O},aS=(a,f)=>{const g=CC(f);return ao(Fe(g,O=>({key:O,value:a+"-"+O})))},lS=a=>ca("partUids","partUids",xe(f=>aS(f.uid,a)),ea());var eT=Object.freeze({__proto__:null,generate:wp,generateOne:oS,schemas:SC,names:CC,substitutes:sS,components:Qy,defaultUids:aS,defaultUidsSchema:lS,getAllParts:rS,getAllPartNames:iS,getPart:ti,getPartOrDie:Sp,getParts:kC,getPartsOrDie:F1});const o0=(a,f)=>(a.length>0?[Ic("parts",a)]:[]).concat([Gt("uid"),_t("dom",{}),_t("components",[]),Cg("originalSpec"),_t("debug.sketcher",{})]).concat(f),s0=(a,f,g,O,x)=>{const P=o0(O,x);return Ei(a+" [SpecSchema]",Hr(P.concat(f)),g)},cS=(a,f,g,O)=>{const x=Fg(O),P=s0(a,f,x,[],[]);return g(P,x)},uS=(a,f,g,O,x)=>{const P=Fg(x),I=SC(g),Q=lS(g),U=s0(a,f,P,I,[Q]),ee=sS(a,U,g),se=Qy(a,U,ee.internals());return O(U,se,P,ee.externals())},Zf=a=>ns(a,"uid"),Fg=a=>Zf(a)?a:{...a,uid:ag("uid")},tT=a=>a.uid!==void 0,Xv=Hr([Gt("name"),Gt("factory"),Gt("configFields"),_t("apis",{}),_t("extraApis",{})]),nT=Hr([Gt("name"),Gt("factory"),Gt("configFields"),Gt("partFields"),_t("apis",{}),_t("extraApis",{})]),sd=a=>{const f=Ei("Sketcher for "+a.name,Xv,a),g=P=>cS(f.name,f.configFields,f.factory,P),O=ms(f.apis,xh),x=ms(f.extraApis,(P,I)=>mb(P,I));return{name:f.name,configFields:f.configFields,sketch:g,...O,...x}},_c=a=>{const f=Ei("Sketcher for "+a.name,nT,a),g=I=>uS(f.name,f.configFields,f.partFields,f.factory,I),O=wp(f.name,f.partFields),x=ms(f.apis,xh),P=ms(f.extraApis,(I,Q)=>mb(I,Q));return{name:f.name,partFields:f.partFields,configFields:f.configFields,sketch:g,parts:O,...x,...P}},H1=a=>xa("input")(a)&&ui(a,"type")!=="radio"||xa("textarea")(a);var xC=Object.freeze({__proto__:null,getCurrent:(a,f,g)=>f.find(a)});const oT=[Gt("find")],Ds=Za({f
`+xc),Hp&&(xc=$p(xc,Lo," "),xc=$p(xc,Po," "),xc=$p(xc,wr," ")),Ot&&PL?Ot.createHTML(xc):xc},f.setConfig=function(Ms){iU(Ms),G2=!0},f.clearConfig=function(){FE=null,G2=!1},f.isValidAttribute=function(Ms,Ht,lo){FE||iU({});const zo=Yd(Ms),cl=Yd(Ht);return Tq(zo,cl,lo)},f.addHook=function(Ms,Ht){typeof Ht=="function"&&(Un[Ms]=Un[Ms]||[],CS(Un[Ms],Ht))},f.removeHook=function(Ms){if(Un[Ms])return K6(Un[Ms])},f.removeHooks=function(Ms){Un[Ms]&&(Un[Ms]=[])},f.removeAllHooks=function(){Un={}},f}var sD=$S();const zT=a=>sD().sanitize(a);var qf=tinymce.util.Tools.resolve("tinymce.util.I18n");const c7={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},rD="temporary-placeholder",WT=a=>()=>nn(a,rD).getOr("!not found!"),PS=(a,f)=>{const g=a.toLowerCase();if(qf.isRtl()){const O=mr(g,"-rtl");return ns(f,O)?O:g}else return g},ZT=(a,f)=>nn(f,PS(a,f)),UT=(a,f)=>{const g=f();return ZT(a,g).getOrThunk(WT(g))},qT=(a,f,g)=>{const O=f();return ZT(a,O).or(g).getOrThunk(WT(O))},u7=a=>qf.isRtl()?ns(c7,a):!1,nk=()=>ss("add-focusable",[xr(a=>{Cb(a.element,"svg").each(f=>Mn(f,"focusable","false"))})]),iD=(a,f,g,O)=>{var x,P;const I=u7(f)?["tox-icon--flip"]:[],Q=nn(g,PS(f,g)).or(O).getOrThunk(WT(g));return{dom:{tag:a.tag,attributes:(x=a.attributes)!==null&&x!==void 0?x:{},classes:a.classes.concat(I),innerHtml:Q},behaviours:On([...(P=a.behaviours)!==null&&P!==void 0?P:[],nk()])}},Pm=(a,f,g,O=q.none())=>iD(f,a,g(),O),d7=(a,f,g)=>{const O=g(),x=gt(a,P=>ns(O,PS(P,O)));return iD(f,x.getOr(rD),O,q.none())},aD={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},XT=sd({name:"Notification",factory:a=>{const f=Ar({dom:Z1(`<p>${zT(a.translationProvider(a.text))}</p>`),behaviours:On([Yo.config({})])}),g=we=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${we}%`}}}),O=we=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${we}%`}}),x=Ar({dom:{tag:"div",classes:a.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[g(0)]},O(0)],behaviours:On([Yo.config({})])}),Q={updateProgress:(we,Re)=>{we.getSystem().isConnected()&&x.getOpt(we).each(Je=>{Yo.set(Je,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[g(Re)]},O(Re)])})},updateText:(we,Re)=>{if(we.getSystem().isConnected()){const Je=f.get(we);Yo.set(Je,[Xi(Re)])}}},U=pt([a.icon.toArray(),a.level.toArray(),a.level.bind(we=>q.from(aD[we])).toArray()]),ee=Ar(Wl.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Pm("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":a.translationProvider("Close")}},a.iconProvider)],action:we=>{a.onAction(we)}})),se=d7(U,{tag:"div",classes:["tox-notification__icon"]},a.iconProvider),he={dom:{tag:"div",classes:["tox-notification__body"]},components:[f.asSpec()],behaviours:On([Yo.config({})])},be=[se,he];return{uid:a.uid,dom:{tag:"div",attributes:{role:"alert"},classes:a.level.map(we=>["tox-notification","tox-notification--in",`tox-notification--${we}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:On([Ao.config({}),ss("notification-events",[qt(gi(),we=>{ee.getOpt(we).each(Ao.focus)})])]),components:be.concat(a.progress?[x.asSpec()]:[]).concat(a.closeButton?[ee.asSpec()]:[]),apis:Q}},configFields:[er("level"),Gt("progress"),er("icon"),Gt("onAction"),Gt("text"),Gt("iconProvider"),Gt("translationProvider"),ya("closeButton",!0)],apis:{updateProgress:(a,f,g)=>{a.updateProgress(f,g)},updateText:(a,f,g)=>{a.updateText(f,g)}}});var jT=(a,f,g)=>{const O=f.backstage.shared,x=()=>{const U=Rr(nt.fromDom(a.getContentAreaContainer())),ee=Ea(),se=Au(ee.x,U.x,U.right),he=Au(ee.y,U.y,U.bottom),be=Math.max(U.right,ee.right),we=Math.max(U.bottom,ee.bottom);return q.some(Cr(se,he,be-se,we-he))};return{open:(U,ee)=>{const se=()=>{ee(),Yi.hide(be)},he=Ql(XT.sketch({text:U.text,level:ct(["s
2024-08-22 17:59:06 +03:00
Cannot use it for: `+Pf(ee.element)+`
2024-08-23 18:15:18 +03:00
The conflicting element is`+(Ss(he.element)?" ":" not ")+"already in the DOM")},x=ee=>{const se=g(ee);Xr(f,se)&&O(ee,se);const he=[ee];a.registerId(he,se,ee.events),f[se]=ee},P=ee=>{sp(ee.element).each(se=>{delete f[se],a.unregisterId(se)})};return{find:(ee,se,he)=>a.find(ee,se,he),filter:ee=>a.filterByType(ee),register:x,unregister:P,getById:ee=>nn(f,ee)}},Dp=sd({name:"Container",factory:a=>{const{attributes:f,...g}=a.dom;return{uid:a.uid,dom:{tag:"div",attributes:{role:"presentation",...f},...g},components:a.components,behaviours:_p(a.containerBehaviours),events:a.events,domModification:a.domModification,eventOrder:a.eventOrder}},configFields:[_t("components",[]),il("containerBehaviours",[]),_t("events",{}),_t("domModification",{}),_t("eventOrder",{})]}),Wk=a=>{const f=at=>ba(a.element).fold(St,st=>Us(at,st)),g=_M(),O=(at,st)=>g.find(f,at,st),x=f8(a.element,{triggerEvent:(at,st)=>kb(at,st.target,Ot=>O3(O,at,st,Ot))}),P={debugInfo:ne("real"),triggerEvent:(at,st,Ot)=>{kb(at,st,hn=>OM(O,at,Ot,st,hn))},triggerFocus:(at,st)=>{sp(at).fold(()=>{ji(at)},Ot=>{kb(xd(),at,hn=>(m8(O,xd(),{originator:st,kill:j,prevent:j,target:at},at,hn),!1))})},triggerEscape:(at,st)=>{P.triggerEvent("keydown",at.element,st.event)},getByUid:at=>Je(at),getByDom:at=>Ct(at),build:Ql,buildOrPatch:Sb,addToGui:at=>{U(at)},removeFromGui:at=>{ee(at)},addToWorld:at=>{I(at)},removeFromWorld:at=>{Q(at)},broadcast:at=>{be(at)},broadcastOn:(at,st)=>{we(at,st)},broadcastEvent:(at,st)=>{Re(at,st)},isConnected:St},I=at=>{at.connect(P),Ji(at.element)||(g.register(at),mt(at.components(),I),P.triggerEvent(vh(),at.element,{target:at.element}))},Q=at=>{Ji(at.element)||(mt(at.components(),Q),g.unregister(at)),at.disconnect()},U=at=>{Ig(a,at)},ee=at=>{km(at)},se=()=>{x.unbind(),Pc(a.element)},he=at=>{const st=g.filter(tp());mt(st,Ot=>{const hn=Ot.descHandler;fg(hn)(at)})},be=at=>{he({universal:!0,data:at})},we=(at,st)=>{he({universal:!1,channels:at,data:st})},Re=(at,st)=>{const Ot=g.filter(at);return p8(Ot,st)},Je=at=>g.getById(at).fold(()=>Zo.error(new Error('Could not find component with uid: "'+at+'" in system.')),Zo.value),Ct=at=>{const st=sp(at).getOr("not found");return Je(st)};return I(a),{root:a,element:a.element,destroy:se,add:U,remove:ee,getByUid:Je,getByDom:Ct,addToWorld:I,removeFromWorld:Q,broadcast:be,broadcastOn:we,broadcastEvent:Re}},v8=(a,f)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:Fe(a.items,f.interpreter)}),O8=ne([_t("prefix","form-field"),il("fieldBehaviours",[Ds,Ln])]),y8=ne([Mu({schema:[Gt("dom")],name:"label"}),Mu({factory:{sketch:a=>({uid:a.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:a.text}})},schema:[Gt("text")],name:"aria-descriptor"}),yc({factory:{sketch:a=>{const f=gn(a,["factory"]);return a.factory.sketch(f)}},schema:[Gt("factory")],name:"field"})]),_8=(a,f,g,O)=>{const x=$a(a.fieldBehaviours,[Ds.config({find:Q=>ti(Q,a,"field")}),Ln.config({store:{mode:"manual",getValue:Q=>Ds.getCurrent(Q).bind(Ln.getValue),setValue:(Q,U)=>{Ds.getCurrent(Q).each(ee=>{Ln.setValue(ee,U)})}}})]),P=kr([xr((Q,U)=>{const ee=kC(Q,a,["label","field","aria-descriptor"]);ee.field().each(se=>{const he=Vn(a.prefix);ee.label().each(be=>{Mn(be.element,"for",he),Mn(se.element,"id",he)}),ee["aria-descriptor"]().each(be=>{const we=Vn(a.prefix);Mn(be.element,"id",we),Mn(se.element,"aria-describedby",we)})})})]),I={getField:Q=>ti(Q,a,"field"),getLabel:Q=>ti(Q,a,"label")};return{uid:a.uid,dom:a.dom,components:f,behaviours:x,events:P,apis:I}},$r=_c({name:"FormField",configFields:O8(),partFields:y8(),factory:_8,apis:{getField:(a,f)=>a.getField(f),getLabel:(a,f)=>a.getLabel(f)}});var Zk=Object.freeze({__proto__:null,exhibit:(a,f)=>Qc({attributes:ao([{key:f.tabAttr,value:"true"}])})}),w8=[_t("tabAttr","data-alloy-tabstop")];const $i=Za({fields:w8,name:"tabstopping",active:Zk});var S8=tinymce.util.Tools.resolve("tinymce.html.Entities");const t2=(a,f,g,O)=>{const x=k8(a,f,g,O);return $r.sketch(x)},C8=(a,f)=>t2(a,f,[],[]),k8=(a,f,g,O)=>({dom:n2(g),components:a.toArray().concat([f]),fieldBehaviours:On(O)}
`+JSON.stringify(a));p0.setItem(Ex,JSON.stringify(a))},wQ=a=>{const f=AN();return nn(f,a).getOr([])},P$=(a,f)=>{if(!$$(a))return;const g=AN(),O=nn(g,f).getOr([]),x=jn(O,P=>P!==a);g[f]=[a].concat(x).slice(0,TN),Tx(g)},D_=a=>!!a,$N=a=>ms(J1.makeMap(a,/[, ]/),D_),D$=a=>q.from(bD(a)),PN=a=>{const f=q.from(tA(a)).filter(D_).map($N);return D$(a).fold(Tt,g=>f.fold(St,O=>Ts(O).length>0?O:!1))},DN=(a,f)=>{const g=PN(a);return R(g)?g?D$(a):q.none():g[f]?D$(a):q.none()},RN=(a,f)=>DN(a,f).map(g=>O=>Xc.nu(x=>{const P=(Q,U)=>{if(!p(Q))throw new Error("Expected value to be string");if(U!==void 0&&!b(U))throw new Error("Expected meta to be a object");x({value:Q,meta:U})},I={filetype:f,fieldname:O.fieldname,...q.from(O.meta).getOr({})};g.call(a,P,O.value,I)})),MN=a=>q.from(a).filter(p).getOrUndefined(),R$=a=>nA(a)?q.some({targets:yQ.find(a.getBody()),anchorTop:MN(ak(a)),anchorBottom:MN(OD(a))}):q.none(),Ax=a=>q.from(eA(a)),SQ=a=>({getHistory:wQ,addToHistory:P$,getLinkInformation:()=>R$(a),getValidationHandler:()=>Ax(a),getUrlPicker:f=>RN(a,f)}),CQ=(a,f,g,O)=>{const x=bo(!1),P=jc(f),I={icons:()=>f.ui.registry.getAll().icons,menuItems:()=>f.ui.registry.getAll().menuItems,translate:qf.translate,isDisabled:()=>f.mode.isReadOnly()||!f.ui.isEnabled(),getOption:f.options.get},Q=SQ(f),U=cQ(f),ee=vN(f),se=QU(f),he=()=>x.get(),be=Ct=>x.set(Ct),we={shared:{providers:I,anchors:JH(f,g,O,P.isPositionedAtTop),header:P},urlinput:Q,styles:U,colorinput:ee,dialog:se,isContextMenuOpen:he,setContextMenuState:be},Re={...we,shared:{...we.shared,interpreter:Ct=>v2(Ct,{},Re),getSink:a.popup}},Je={...we,shared:{...we.shared,interpreter:Ct=>v2(Ct,{},Je),getSink:a.dialog}};return{popup:Re,dialog:Je}},R_=(a,f,g)=>{const O=(Wt,yn)=>{mt([f,...g],An=>{An.broadcastEvent(Wt,yn)})},x=(Wt,yn)=>{mt([f,...g],An=>{An.broadcastOn([Wt],yn)})},P=Wt=>x(Bh(),{target:Wt.target}),I=Wu(),Q=sc(I,"touchstart",P),U=sc(I,"touchmove",Wt=>O(ec(),Wt)),ee=sc(I,"touchend",Wt=>O(ju(),Wt)),se=sc(I,"mousedown",P),he=sc(I,"mouseup",Wt=>{Wt.raw.button===0&&x(Yw(),{target:Wt.target})}),be=Wt=>x(Bh(),{target:nt.fromDom(Wt.target)}),we=Wt=>{Wt.button===0&&x(Yw(),{target:nt.fromDom(Wt.target)})},Re=()=>{mt(a.editorManager.get(),Wt=>{a!==Wt&&Wt.dispatch("DismissPopups",{relatedTarget:a})})},Je=Wt=>O($f(),xl(Wt)),Ct=Wt=>{x(B1(),{}),O(cf(),xl(Wt))},at=At(nt.fromDom(a.getElement())),st=Mb(at,"scroll",Wt=>{requestAnimationFrame(()=>{const yn=a.getContainer();if(yn!=null){const rs=b0(a,f.element).map(Un=>[Un.element,...Un.others]).getOr([]);dn(rs,Un=>Us(Un,Wt.target))&&(a.dispatch("ElementScroll",{target:Wt.target.dom}),O(yh(),Wt))}})}),Ot=()=>x(B1(),{}),hn=Wt=>{Wt.state&&x(Bh(),{target:nt.fromDom(a.getContainer())})},jt=Wt=>{x(Bh(),{target:nt.fromDom(Wt.relatedTarget.getContainer())})};a.on("PostRender",()=>{a.on("click",be),a.on("tap",be),a.on("mouseup",we),a.on("mousedown",Re),a.on("ScrollWindow",Je),a.on("ResizeWindow",Ct),a.on("ResizeEditor",Ot),a.on("AfterProgressState",hn),a.on("DismissPopups",jt)}),a.on("remove",()=>{a.off("click",be),a.off("tap",be),a.off("mouseup",we),a.off("mousedown",Re),a.off("ScrollWindow",Je),a.off("ResizeWindow",Ct),a.off("ResizeEditor",Ot),a.off("AfterProgressState",hn),a.off("DismissPopups",jt),se.unbind(),Q.unbind(),U.unbind(),ee.unbind(),he.unbind(),st.unbind()}),a.on("detach",()=>{mt([f,...g],Yb),mt([f,...g],Wt=>Wt.destroy())})},$l=eT,t1=wC,NN=ne([_t("shell",!1),Gt("makeItem"),_t("setupItem",j),gf.field("listBehaviours",[Yo])]),M$=Mu({name:"items",overrides:()=>({behaviours:On([Yo.config({})])})}),kQ=ne([M$]),xQ=ne("CustomList"),EQ=(a,f,g,O)=>{const x=(Q,U)=>{I(Q).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},ee=>{const se=Yo.contents(ee),he=U.length,be=he-se.length,we=be>0?Zt(be,()=>a.makeItem()):[],Re=se.slice(he);mt(Re,Ct=>Yo.remove(ee,Ct)),mt(we,Ct=>Yo.append(ee,Ct));const Je=Yo.contents(ee);mt(Je,(Ct,at)=>{a.setupItem(Q,Ct,U[at],at)})})},P=a.shell?{behaviours:[Yo.config({})],compo
2024-08-22 17:59:06 +03:00
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>
</svg>
2024-08-23 18:15:18 +03:00
`;const WP=a=>a.nodeName==="BR"||!!a.getAttribute("data-mce-bogus")||a.getAttribute("data-mce-type")==="bookmark",wE=(a,f,g)=>{var O;const x=(O=f.delimiter)!==null&&O!==void 0?O:"",P=(ee,se,he)=>Wl.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":he,"aria-level":he+1}},components:[Xi(ee)],action:be=>{a.focus(),a.selection.select(se),a.nodeChanged()},buttonBehaviours:On([al.button(g.isDisabled),Ol()])}),I=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Xi(` ${x} `)]}),Q=ee=>po(ee,(se,he,be)=>{const we=P(he.name,he.element,be);return be===0?se.concat([we]):se.concat([I(),we])},[]),U=ee=>{const se=[];let he=ee.length;for(;he-- >0;){const be=ee[he];if(be.nodeType===1&&!WP(be)){const we=IR(a,be);if(we.isDefaultPrevented()||se.push({name:we.name,element:be}),we.isPropagationStopped())break}}return se};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:On([vo.config({mode:"flow",selector:"div[role=button]"}),ko.config({disabled:g.isDisabled}),Ol(),$i.config({}),Yo.config({}),ss("elementPathEvents",[xr((ee,se)=>{a.shortcuts.add("alt+F11","focus statusbar elementpath",()=>vo.focusIn(ee)),a.on("NodeChange",he=>{const be=U(he.parents),we=be.length>0?Q(be):[];Yo.set(ee,we)})})])]),components:[]}};var D0;(function(a){a[a.None=0]="None",a[a.Both=1]="Both",a[a.Vertical=2]="Vertical"})(D0||(D0={}));const vZ=(a,f,g,O,x)=>{const P={height:I2(O+f.top,e_(a),GT(a))};return g===D0.Both&&(P.width=I2(x+f.left,YT(a),sk(a))),P},hL=(a,f,g)=>{const O=nt.fromDom(a.getContainer()),x=vZ(a,f,g,Nr(O),Ii(O));vs(x,(P,I)=>{J(P)&&Wn(O,I,wP(P))}),MR(a)},OZ=a=>{const f=_D(a);return f===!1?D0.None:f==="both"?D0.Both:D0.Vertical},SE=(a,f,g,O)=>{const P=Ws(g*20,O*20);return hL(a,P,f),q.some(!0)},TO=(a,f)=>{const g=OZ(a);if(g===D0.None)return q.none();const O=g===D0.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return q.some(Pm("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:f.translate("Resize"),"aria-label":f.translate(O)},behaviours:[xO.config({mode:"mouse",repositionTarget:!1,onDrag:(x,P,I)=>hL(a,I,g),blockerClass:"tox-blocker"}),vo.config({mode:"special",onLeft:()=>SE(a,g,-1,0),onRight:()=>SE(a,g,1,0),onUp:()=>SE(a,g,0,-1),onDown:()=>SE(a,g,0,1)}),$i.config({}),Ao.config({})]},f.icons))},mL=(a,f)=>{const g=(O,x,P)=>Yo.set(O,[Xi(f.translate(["{0} "+P,x[P]]))]);return Wl.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:On([al.button(f.isDisabled),Ol(),$i.config({}),Yo.config({}),Ln.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ss("wordcount-events",[vc(O=>{const x=Ln.getValue(O),P=x.mode==="words"?"characters":"words";Ln.setValue(O,{mode:P,count:x.count}),g(O,x.count,P)}),xr(O=>{a.on("wordCountUpdate",x=>{const{mode:P}=Ln.getValue(O);Ln.setValue(O,{mode:P,count:x.wordCount}),g(O,x.wordCount,P)})})])]),eventOrder:{[au()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},yZ=(a,f)=>{const g=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v6",rel:"noopener",target:"_blank","aria-label":qf.translate(["Powered by {0}","Tiny"])},innerHtml:bZ.trim()},behaviours:On([Ao.config({})])}]}),O=()=>{const Q=Tk("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Xi(qf.translate(["Press {0} for help",Q]))]}},x=()=>{const Q=[];return a.hasPlugin("wordcount")&&Q.push(mL(a,f)),sA(a)&&Q.push(g()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:Q}},P=()=>{const Q=[],U=uk(a),ee=n_(a),se=sA(a)||a.hasPlugin("wordcount"),he=()=>{const be="tox-statusbar__text-container--flex-start",we="tox-statusbar__text-container--flex-end",Re="tox-statusbar__text-container--space-around";if(U){const Je="tox-statusbar__text-container-3-cols";return!se&&!ee
`+JSON.stringify(f,null,2)).message),getBounds:a.getDragBounds})])})}),yc({schema:[Gt("dom")],name:"title"}),yc({factory:ZP,schema:[Gt("dom")],name:"close"}),yc({factory:ZP,schema:[Gt("dom")],name:"body"}),Mu({factory:ZP,schema:[Gt("dom")],name:"footer"}),Wf({factory:{sketch:(a,f)=>({...a,dom:f.dom,components:f.components})},schema:[_t("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),_t("components",[])],name:"blocker"})]),kZ=(a,f,g,O)=>{const x=fs(),P=we=>{x.set(we);const Re=a.lazySink(we).getOrDie(),Je=O.blocker(),Ct=Re.getSystem().build({...Je,components:Je.components.concat([cu(we)]),behaviours:On([Ao.config({}),ss("dialog-blocker-events",[$d(gi(),()=>{Bp.isBlocked(we)?j():vo.focusIn(we)})])])});Ig(Re,Ct),vo.focusIn(we)},I=we=>{x.clear(),ba(we.element).each(Re=>{we.getSystem().getByDom(Re).each(Je=>{km(Je)})})},Q=we=>Sp(we,a,"body"),U=we=>ti(we,a,"footer"),ee=(we,Re)=>{Bp.block(we,Re)},se=we=>{Bp.unblock(we)},he=Vn("modal-events"),be={...a.eventOrder,[bc()]:[he].concat(a.eventOrder["alloy.system.attached"]||[])};return{uid:a.uid,dom:a.dom,components:f,apis:{show:P,hide:I,getBody:Q,getFooter:U,setIdle:se,setBusy:ee},eventOrder:be,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:$a(a.modalBehaviours,[Yo.config({}),vo.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt,firstTabstop:a.firstTabstop}),Bp.config({getRoot:x.get}),ss(he,[xr(we=>{wZ(we.element,Sp(we,a,"title").element)})])])}},ll=_c({name:"ModalDialog",configFields:SZ(),partFields:CZ(),factory:kZ,apis:{show:(a,f)=>{a.show(f)},hide:(a,f)=>{a.hide(f)},getBody:(a,f)=>a.getBody(f),getFooter:(a,f)=>a.getFooter(f),setBusy:(a,f,g)=>{a.setBusy(f,g)},setIdle:(a,f)=>{a.setIdle(f)}}}),z2=Jn([Xa,kA].concat(dO)),UP=Su,Z_=[Ck("button"),Xf,Kl("align","end",["start","end"]),qg,Qh,c1("buttonType",["primary","secondary"])],R0=[...Z_,X1],U_=[Li("type",["submit","cancel","custom"]),...R0],xZ=[Li("type",["menu"]),Ug,QS,Xf,tl("items",z2),...Z_],gL=[...Z_,Li("type",["togglebutton"]),Fs("tooltip"),Xf,Ug,ya("active",!1)],bL=ys("type",{submit:U_,cancel:U_,custom:U_,menu:xZ,togglebutton:gL}),vL=[Xa,X1,Li("level",["info","warn","error","success"]),xA,_t("url","")],EZ=Jn(vL),TZ=a=>[Xa,a],AZ=[Xa,X1,Qh,Ck("button"),Xf,UD,c1("buttonType",["primary","secondary","toolbar"]),qg],OL=Jn(AZ),AO=[Xa,kA],qh=AO.concat([wk]),$Z=AO.concat([_k,Qh]),PZ=Jn($Z),DZ=Su,yL=qh.concat([qD("auto")]),RZ=Jn(yL),MZ=_d([l_,X1,xA]),NZ=qh.concat([Fl("storageKey","default")]),qP=Jn(NZ),XP=Ta,_L=Jn(qh),IZ=Ta,BZ=AO.concat([Fl("tag","textarea"),Fs("scriptId"),Fs("scriptUrl"),u1("settings",void 0)]),wL=AO.concat([Fl("tag","textarea"),Cu("init")]),LZ=of(a=>li("customeditor.old",Hr(wL),a).orThunk(()=>li("customeditor.new",Hr(BZ),a))),FZ=Ta,SL=Jn(qh),HZ=rb(),CE=a=>[Xa,Km("columns"),a],X_=[Xa,Fs("html"),Kl("presets","presentation",["presentation","document"])],kE=Jn(X_),CL=qh.concat([ya("border",!1),ya("sandboxed",!0),ya("streamContent",!1),ya("transparent",!0)]),xE=Jn(CL),qd=Ta,EE=Jn(AO.concat([nl("height")])),kL=Jn([Fs("url"),rf("zoom"),rf("cachedWidth"),rf("cachedHeight")]),xL=qh.concat([nl("inputMode"),nl("placeholder"),ya("maximized",!1),Qh]),QZ=Jn(xL),VZ=Ta,M0=a=>[Xa,_k,a,Kl("align","start",["start","center","end"])],cq=[X1,l_],zZ=[X1,tl("items",lh("items",()=>jP))],jP=Zn([Jn(cq),Jn(zZ)]),j_=qh.concat([tl("items",jP),Qh]),TE=Jn(j_),EL=Ta,WZ=qh.concat([am("items",[X1,l_]),iu("size",1),Qh]),ZZ=Jn(WZ),UZ=Ta,qZ=qh.concat([ya("constrain",!0),Qh]),Y_=Jn(qZ),XZ=Jn([Fs("width"),Fs("height")]),jZ=AO.concat([_k,iu("min",0),iu("max",0)]),YZ=Jn(jZ),uq=Ym,GZ=[Xa,tl("header",Ta),tl("cells",yd(Ta))],KZ=Jn(GZ),W2=qh.concat([nl("placeholder"),ya("maximized",!1),Qh]),JZ=Jn(W2),eU=Ta,YP=[Li("type",["directory","leaf"]),zD,Fs("id"),ua("menu",$2)],tU=Jn(YP),s=YP.concat([tl("children",lh("children",()=>un("type",{directory:l,leaf:tU})))]),l=Jn(s),d=un("type",{directory:l,leaf:tU}),m=[Xa,tl("items",d),ch("onLeafAction"),ch("onToggleExpand"),Jl("defaultExpandedIds",[],Ta),nl("defaultSelectedId")],v=Jn(m),w=qh.concat([Kl("filetype","file",
Actual: `+Vr.join(","));if(!Nt(K,Cl=>Zt(Vr,Cl)))throw new Error("Not all branches were specified when using match. Specified: "+Vr.join(", ")+`
Required: `+K.join(", "));return tr[gn].apply(null,ao)},log:tr=>{console.log(tr,{constructors:K,constructor:gn,params:ao})}}}}),ve}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Zn=(z,K)=>{const ve=Jc.fromTable(z);return ai(ve,K).bind(ot=>{const Vt=ot[ot.length-1],gn=ot[0].row,xn=Vt.row+Vt.rowspan,ao=ve.all.slice(gn,xn);return tt(ao)}).getOr("")},Ha=z=>Dl(z,"rgb")?Bl(z):z,sb=z=>{const K=Oo.fromDom(z);return{borderwidth:At(K,"border-width").getOr(""),borderstyle:At(K,"border-style").getOr(""),bordercolor:At(K,"border-color").map(Ha).getOr(""),backgroundcolor:At(K,"background-color").map(Ha).getOr("")}},_d=z=>{const K=z[0],ve=z.slice(1);return de(ve,Ae=>{de(Se(K),ot=>{Be(Ae,(Vt,gn)=>{const xn=K[ot];xn!==""&&ot===gn&&xn!==Vt&&(K[ot]="")})})}),K},ea=(z,K,ve,Ae)=>Ut(z,ot=>!y(ve.formatter.matchNode(Ae,K+ot))).getOr(""),tf=j(ea,["left","center","right"],"align"),Ym=j(ea,["top","middle","bottom"],"valign"),Ta=(z,K)=>{const ve=pd(z),Ae=ml(z),ot=()=>({borderstyle:Le(ve,"border-style").getOr(""),bordercolor:Ha(Le(ve,"border-color").getOr("")),backgroundcolor:Ha(Le(ve,"background-color").getOr(""))}),Vt={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},gn=()=>{const _i=ve["border-width"];return tu(z)&&_i?{border:_i}:Le(Ae,"border").fold(()=>({}),tr=>({border:tr}))},xn=K?ot():{},ao=()=>{const _i=Le(ve,"border-spacing").or(Le(Ae,"cellspacing")).fold(()=>({}),Vr=>({cellspacing:Vr})),tr=Le(ve,"border-padding").or(Le(Ae,"cellpadding")).fold(()=>({}),Vr=>({cellpadding:Vr}));return{..._i,...tr}};return{...Vt,...ve,...Ae,...xn,...gn(),...ao()}},Su=z=>Tn(Oo.fromDom(z)).map(K=>{const ve={selection:Ef(z.cells)};return Zn(K,ve)}).getOr(""),Xp=(z,K,ve)=>{const Ae=(xn,ao)=>{const Uo=At(Oo.fromDom(ao),"border-width");return tu(z)&&Uo.isSome()?Uo.getOr(""):xn.getAttrib(ao,"border")||Nl(z.dom,ao,"border-width")||Nl(z.dom,ao,"border")||""},ot=z.dom,Vt=tu(z)?ot.getStyle(K,"border-spacing")||ot.getAttrib(K,"cellspacing"):ot.getAttrib(K,"cellspacing")||ot.getStyle(K,"border-spacing"),gn=tu(z)?Nl(ot,K,"padding")||ot.getAttrib(K,"cellpadding"):ot.getAttrib(K,"cellpadding")||Nl(ot,K,"padding");return{width:ot.getStyle(K,"width")||ot.getAttrib(K,"width"),height:ot.getStyle(K,"height")||ot.getAttrib(K,"height"),cellspacing:Vt??"",cellpadding:gn??"",border:Ae(ot,K),caption:!!ot.select("caption",K)[0],class:ot.getAttrib(K,"class",""),align:tf(z,K),...ve?sb(K):{}}},wd=(z,K,ve)=>{const Ae=z.dom;return{height:Ae.getStyle(K,"height")||Ae.getAttrib(K,"height"),class:Ae.getAttrib(K,"class",""),type:Su(K),align:tf(z,K),...ve?sb(K):{}}},jp=(z,K,ve,Ae)=>{const ot=z.dom,Vt=Ae.getOr(K),gn=(xn,ao)=>ot.getStyle(xn,ao)||ot.getAttrib(xn,ao);return{width:gn(Vt,"width"),height:gn(K,"height"),scope:ot.getAttrib(K,"scope"),celltype:Ec(K),class:ot.getAttrib(K,"class",""),halign:tf(z,K),valign:Ym(z,K),...ve?sb(K):{}}},nf=(z,K)=>{const ve=Jc.fromTable(z),Ae=Jc.justCells(ve),ot=Yn(Ae,Vt=>rn(K,gn=>ts(Vt.element,gn)));return mt(ot,Vt=>({element:Vt.element.dom,column:Jc.getColumnAt(ve,Vt.column).map(gn=>gn.element.dom)}))},un=(z,K,ve,Ae)=>{Ae("scope")&&z.setAttrib("scope",ve.scope),Ae("class")&&z.setAttrib("class",ve.class),Ae("height")&&z.setStyle("height",As(ve.height)),Ae("width")&&K.setStyle("width",As(ve.width))},rb=(z,K,ve)=>{ve("backgroundcolor")&&z.setFormat("tablecellbackgroundcolor",K.backgroundcolor),ve("bordercolor")&&z.setFormat("tablecellbordercolor",K.bordercolor),ve("borderstyle")&&z.setFormat("tablecellborderstyle",K.borderstyle),ve("borderwidth")&&z.setFormat("tablecellborderwidth",As(K.borderwidth))},of=(z,K,ve,Ae)=>{const ot=K.length===1;de(K,Vt=>{const gn=Vt.element,xn=ot?_e:Ae,ao=su.normal(z,gn),Uo=Vt.column.map(_i=>su.normal(z,_i)).getOr(ao);un(ao,Uo,ve,xn),tm(z)&&rb(ao,ve,xn),Ae("halign")&&dc(z,gn,ve.halign),Ae("valign")&&th(z,gn,ve.valign)})},sf=(z,K)=>{z.execCommand("mceTableCellType",!1,{type:K.celltype,no_events:!0})},ru=(z,K,ve,Ae)=>{const ot=yt(Ae,(Vt,gn)=>ve[gn]!==Vt);q(ot)>0&&K.length>=1&&Tn(K[0]).each(Vt=>{const gn=nf(Vt,K),xn
`),Ue)}),mn.innerHTML=Le.encode((Rt=mn.textContent)!==null&&Rt!==void 0?Rt:""),V(q).highlightElement(mn),Le.setAttrib(mn,"data-mce-highlighted",!0),mn.className=De(mn.className)})})}),q.on("PreInit",()=>{q.parser.addNodeFilter("pre",Le=>{var je;for(let mn=0,Rt=Le.length;mn<Rt;mn++){const Ue=Le[mn];((je=Ue.attr("class"))!==null&&je!==void 0?je:"").indexOf("language-")!==-1&&(Ue.attr("contenteditable","false"),Ue.attr("data-mce-highlighted","false"))}})})},Oe=(q,Le=r)=>je=>{const mn=()=>{je.setEnabled(q.selection.isEditable()),Le(je)};return q.on("NodeChange",mn),mn(),()=>{q.off("NodeChange",mn)}},yt=q=>{const Le=q.selection.getStart();return q.dom.is(Le,'pre[class*="language-"]')},Tt=q=>{const Le=()=>q.execCommand("codesample");q.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:Le,onSetup:Oe(q,je=>{je.setActive(yt(q))})}),q.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:Le,onSetup:Oe(q)})};var St=()=>{o.add("codesample",q=>{R(q),Te(q),Tt(q),ne(q),q.on("dblclick",Le=>{W(Le.target)&&_e(q)})})};St()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ge,Xe,$t)=>{var Qt;return $t(Ge,Xe.prototype)?!0:((Qt=Ge.constructor)===null||Qt===void 0?void 0:Qt.name)===Xe.name},n=Ge=>{const Xe=typeof Ge;return Ge===null?"null":Xe==="object"&&Array.isArray(Ge)?"array":Xe==="object"&&e(Ge,String,($t,Qt)=>Qt.isPrototypeOf($t))?"string":Xe},r=Ge=>Xe=>n(Xe)===Ge,c=r("string"),u=r("object"),h=r("array"),p=Ge=>Ge==null,b=Ge=>!p(Ge);class y{constructor(Xe,$t){this.tag=Xe,this.value=$t}static some(Xe){return new y(!0,Xe)}static none(){return y.singletonNone}fold(Xe,$t){return this.tag?$t(this.value):Xe()}isSome(){return this.tag}isNone(){return!this.tag}map(Xe){return this.tag?y.some(Xe(this.value)):y.none()}bind(Xe){return this.tag?Xe(this.value):y.none()}exists(Xe){return this.tag&&Xe(this.value)}forall(Xe){return!this.tag||Xe(this.value)}filter(Xe){return!this.tag||Xe(this.value)?this:y.none()}getOr(Xe){return this.tag?this.value:Xe}or(Xe){return this.tag?this:Xe}getOrThunk(Xe){return this.tag?this.value:Xe()}orThunk(Xe){return this.tag?this:Xe()}getOrDie(Xe){if(this.tag)return this.value;throw new Error(Xe??"Called getOrDie on None")}static from(Xe){return b(Xe)?y.some(Xe):y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Xe){this.tag&&Xe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}y.singletonNone=new y(!1);const k=Array.prototype.push,A=(Ge,Xe)=>{for(let $t=0,Qt=Ge.length;$t<Qt;$t++){const eo=Ge[$t];Xe(eo,$t)}},R=Ge=>{const Xe=[];for(let $t=0,Qt=Ge.length;$t<Qt;++$t){if(!h(Ge[$t]))throw new Error("Arr.flatten item "+$t+" was not an array, input: "+Ge);k.apply(Xe,Ge[$t])}return Xe},N=Ge=>{let Xe=Ge;return{get:()=>Xe,set:eo=>{Xe=eo}}},F=Object.keys,V=Object.hasOwnProperty,W=(Ge,Xe)=>{const $t=F(Ge);for(let Qt=0,eo=$t.length;Qt<eo;Qt++){const co=$t[Qt],qo=Ge[co];Xe(qo,co)}},J=(Ge,Xe)=>te(Ge,Xe)?y.from(Ge[Xe]):y.none(),te=(Ge,Xe)=>V.call(Ge,Xe),j=Ge=>Xe=>Xe.options.get(Ge),ae=Ge=>{const Xe=Ge.options.register;Xe("audio_template_callback",{processor:"function"}),Xe("video_template_callback",{processor:"function"}),Xe("iframe_template_callback",{processor:"function"}),Xe("media_live_embeds",{processor:"boolean",default:!0}),Xe("media_filter_html",{processor:"boolean",default:!0}),Xe("media_url_resolver",{processor:"function"}),Xe("media_alt_source",{processor:"boolean",default:!0}),Xe("media_poster",{processor:"boolean",default:!0}),Xe("media_dimensions",{processor:"boolean",default:!0})},fe=j("audio_template_callback"),_e=j("video_template_callback"),ne=j("iframe_template_callback"),Se=j("media_live_embeds"),De=j("media_filter_html"),Be=j("media_url_resolver"),Te=j("media_alt_source"),Oe=j("media_poster"),yt=j("media_dimensions");var Tt=tinymce.util.Tools.resolve("tinymce.util.Tools"),St=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),q=tinymce.util.Tools.resolve("tinymce.html.DomParser");const Le=St.DOM,je=
2024-08-22 17:59:06 +03:00
<source src="`+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
2024-08-23 18:15:18 +03:00
`:"")+"</audio>",Ne=(Ge,Xe)=>Xe?Xe(Ge):'<video width="'+Ge.width+'" height="'+Ge.height+'"'+(Ge.poster?' poster="'+Ge.poster+'"':"")+` controls="controls">
2024-08-22 17:59:06 +03:00
<source src="`+Ge.source+'"'+(Ge.sourcemime?' type="'+Ge.sourcemime+'"':"")+` />
`+(Ge.altsource?'<source src="'+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
2024-08-23 18:15:18 +03:00
`:"")+"</video>",Nt=(Ge,Xe)=>{var $t;const Qt=Tt.extend({},Xe);if(!Qt.source&&(Tt.extend(Qt,Rt(($t=Qt.embed)!==null&&$t!==void 0?$t:"",Ge.schema)),!Qt.source))return"";Qt.altsource||(Qt.altsource=""),Qt.poster||(Qt.poster=""),Qt.source=Ge.convertURL(Qt.source,"source"),Qt.altsource=Ge.convertURL(Qt.altsource,"source"),Qt.sourcemime=Ue(Qt.source),Qt.altsourcemime=Ue(Qt.altsource),Qt.poster=Ge.convertURL(Qt.poster,"poster");const eo=cs(Qt.source);if(eo&&(Qt.source=eo.url,Qt.type=eo.type,Qt.allowfullscreen=eo.allowFullscreen,Qt.width=Qt.width||String(eo.w),Qt.height=Qt.height||String(eo.h)),Qt.embed)return Eo(Qt.embed,Qt,!0,Ge.schema);{const co=fe(Ge),qo=_e(Ge),fr=ne(Ge);return Qt.width=Qt.width||"300",Qt.height=Qt.height||"150",Tt.each(Qt,(nt,xo)=>{Qt[xo]=Ge.dom.encode(""+nt)}),Qt.type==="iframe"?gt(Qt,fr):Qt.sourcemime==="application/x-shockwave-flash"?Ut(Qt):Qt.sourcemime.indexOf("audio")!==-1?pt(Qt,co):Ne(Qt,qo)}},pn=Ge=>Ge.hasAttribute("data-mce-object")||Ge.hasAttribute("data-ephox-embed-iri"),xt=Ge=>{Ge.on("click keyup touchend",()=>{const Xe=Ge.selection.getNode();Xe&&Ge.dom.hasClass(Xe,"mce-preview-object")&&Ge.dom.getAttrib(Xe,"data-mce-selected")&&Xe.setAttribute("data-mce-selected","2")}),Ge.on("ObjectResized",Xe=>{const $t=Xe.target;if($t.getAttribute("data-mce-object")){let Qt=$t.getAttribute("data-mce-html");Qt&&(Qt=unescape(Qt),$t.setAttribute("data-mce-html",escape(Eo(Qt,{width:String(Xe.width),height:String(Xe.height)},!1,Ge.schema))))}})},kn={},Dn=(Ge,Xe,$t)=>new Promise((Qt,eo)=>{const co=qo=>(qo.html&&(kn[Ge.source]=qo),Qt({url:Ge.source,html:qo.html?qo.html:Xe(Ge)}));kn[Ge.source]?co(kn[Ge.source]):$t({url:Ge.source},co,eo)}),is=(Ge,Xe)=>Promise.resolve({html:Xe(Ge),url:Ge.source}),Gn=Ge=>Xe=>Nt(Ge,Xe),as=(Ge,Xe)=>{const $t=Be(Ge);return $t?Dn(Xe,Gn(Ge),$t):is(Xe,Gn(Ge))},vr=Ge=>te(kn,Ge),Ns=(Ge,Xe)=>J(Xe,Ge).bind($t=>J($t,"meta")),Vs=(Ge,Xe,$t)=>Qt=>{const eo=()=>J(Ge,Qt),co=()=>J(Xe,Qt),qo=xo=>J(xo,"value").bind(jr=>jr.length>0?y.some(jr):y.none()),fr=()=>eo().bind(xo=>u(xo)?qo(xo).orThunk(co):co().orThunk(()=>y.from(xo))),nt=()=>co().orThunk(()=>eo().bind(xo=>u(xo)?qo(xo):y.from(xo)));return{[Qt]:(Qt===$t?fr():nt()).getOr("")}},Ts=(Ge,Xe)=>{const $t={};return J(Ge,"dimensions").each(Qt=>{A(["width","height"],eo=>{J(Xe,eo).orThunk(()=>J(Qt,eo)).each(co=>$t[eo]=co)})}),$t},Ki=(Ge,Xe)=>{const $t=Xe&&Xe!=="dimensions"?Ns(Xe,Ge).getOr({}):{},Qt=Vs(Ge,$t,Xe);return{...Qt("source"),...Qt("altsource"),...Qt("poster"),...Qt("embed"),...Ts(Ge,$t)}},vs=Ge=>{const Xe={...Ge,source:{value:J(Ge,"source").getOr("")},altsource:{value:J(Ge,"altsource").getOr("")},poster:{value:J(Ge,"poster").getOr("")}};return A(["width","height"],$t=>{J(Ge,$t).each(Qt=>{const eo=Xe.dimensions||{};eo[$t]=Qt,Xe.dimensions=eo})}),Xe},ms=Ge=>Xe=>{const $t=Xe&&Xe.msg?"Media embed handler error: "+Xe.msg:"Media embed handler threw unknown error.";Ge.notificationManager.open({type:"error",text:$t})},dr=Ge=>{const Xe=Ge.selection.getNode(),$t=pn(Xe)?Ge.serializer.serialize(Xe,{selection:!0}):"",Qt=Rt($t,Ge.schema),co=(()=>{if(ws(Qt.source,Qt.type)){const qo=Ge.dom.getRect(Xe);return{width:qo.w.toString().replace(/px$/,""),height:qo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:$t,...Qt,...co}},Oo=(Ge,Xe)=>$t=>{if(c($t.url)&&$t.url.trim().length>0){const Qt=$t.html,co={...Rt(Qt,Xe.schema),source:$t.url,embed:Qt};Ge.setData(vs(co))}},wo=(Ge,Xe)=>{const $t=Ge.dom.select("*[data-mce-object]");for(let Qt=0;Qt<Xe.length;Qt++)for(let eo=$t.length-1;eo>=0;eo--)Xe[Qt]===$t[eo]&&$t.splice(eo,1);Ge.selection.select($t[0])},Gs=(Ge,Xe)=>{const $t=Ge.dom.select("*[data-mce-object]");Ge.insertContent(Xe),wo(Ge,$t),Ge.nodeChanged()},ws=(Ge,Xe)=>b(Xe)&&Xe==="ephox-embed-iri"&&b(cs(Ge)),Pi=(Ge,Xe)=>((Qt,eo)=>Qt.width!==eo.width||Qt.height!==eo.height)(Ge,Xe)&&ws(Xe.source,Ge.type),ts=(Ge,Xe,$t)=>{var Qt;Xe.embed=Pi(Ge,Xe)&&yt($t)?Nt($t,{...Xe,embed:""}):Eo((Qt=Xe.embed)!==null&&Qt!==void 0?Qt:"",Xe,!1,$t.schema),Xe.embed&&(Ge.source===Xe.source||vr(Xe.source))?Gs($t,Xe.embed):as($t,Xe).then(eo=>{Gs($t,eo.html)}).catch(ms($t))},Qi=Ge=>{cons
`));return Oe(pt.split(""),r).length},mn=(gt,Ut)=>{const pt=St(gt,Ut).join("");return Le(pt)},Rt=(gt,Ut)=>{const pt=St(gt,Ut).join("").replace(/\s/g,"");return Le(pt)},Ue=(gt,Ut)=>()=>Ut(gt.getBody(),gt.schema),ct=(gt,Ut)=>()=>Ut(gt.selection.getRng().cloneContents(),gt.schema),dn=gt=>Ue(gt,je),Zt=gt=>({body:{getWordCount:dn(gt),getCharacterCount:Ue(gt,mn),getCharacterCountWithoutSpaces:Ue(gt,Rt)},selection:{getWordCount:ct(gt,je),getCharacterCount:ct(gt,mn),getCharacterCountWithoutSpaces:ct(gt,Rt)},getCount:dn(gt)}),rn=(gt,Ut)=>{gt.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(Ut.body.getWordCount()),String(Ut.selection.getWordCount())],["Characters (no spaces)",String(Ut.body.getCharacterCountWithoutSpaces()),String(Ut.selection.getCharacterCountWithoutSpaces())],["Characters",String(Ut.body.getCharacterCount()),String(Ut.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Fe=(gt,Ut)=>{gt.addCommand("mceWordCount",()=>rn(gt,Ut))},mt=(gt,Ut)=>{let pt=null;return{cancel:()=>{n(pt)||(clearTimeout(pt),pt=null)},throttle:(...pn)=>{n(pt)&&(pt=setTimeout(()=>{pt=null,gt.apply(null,pn)},Ut))}}};var de=tinymce.util.Tools.resolve("tinymce.util.Delay");const Eo=(gt,Ut)=>{gt.dispatch("wordCountUpdate",{wordCount:{words:Ut.body.getWordCount(),characters:Ut.body.getCharacterCount(),charactersWithoutSpaces:Ut.body.getCharacterCountWithoutSpaces()}})},jn=(gt,Ut)=>{Eo(gt,Ut)},Yn=(gt,Ut,pt)=>{const Ne=mt(()=>jn(gt,Ut),pt);gt.on("init",()=>{jn(gt,Ut),de.setEditorTimeout(gt,()=>{gt.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Ne.throttle)},0),gt.on("remove",Ne.cancel)})},po=gt=>{const Ut=()=>gt.execCommand("mceWordCount");gt.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:Ut}),gt.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:Ut})};var cs=(gt=300)=>{o.add("wordcount",Ut=>{const pt=Zt(Ut);return Fe(Ut,pt),po(Ut),Yn(Ut,pt,gt),pt})};cs()})();function create_fragment$l(o){let e,n;return{c(){e=element("div"),n=element("div"),attr(n,"class","form-control"),attr(e,"class","tox-wrapper")},m(r,c){insert$1(r,e,c),append(e,n),n.innerHTML=o[0],o[5](n),o[6](e)},p(r,[c]){c&1&&(n.innerHTML=r[0])},i:noop,o:noop,d(r){r&&detach(e),o[5](null),o[6](null)}}}const toolbar="bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";function instance$l(o,e,n){let{value:r=""}=e,{additionalConfig:c={}}=e,u="",h,p,b;const y=["autoresize","code","image","table","codesample","link","lists","media","wordcount"];onDestroy(()=>{p&&p.destroy()}),onMount(()=>{const N={target:h,toolbar_mode:"sliding",toolbar_sticky:!0,skin:!1,content_css:!1,content_style:contentUiSkinCss.toString()+customcss.toString(),branding:!1,inline:!1,plugins:y,contextmenu:!1,menubar:!1,statusbar:!1,entity_encoding:"raw",convert_urls:!1,toolbar,image_caption:!0,relative_urls:!1,browser_spellcheck:!0,max_height:600,setup(F){p=F,F.on("init",function(V){F.setContent(r??"")}),F.on("change input undo redo",function(V){u=F.getContent(),u!==r&&n(0,r=u)})}};tinymce$1.init({...N,...c})});function k(N){p.execCommand("InsertHTML",!1,N)}function A(N){binding_callbacks[N?"unshift":"push"](()=>{h=N,n(1,h)})}function R(N){binding_callbacks[N?"unshift":"push"](()=>{b=N,n(2,b)})}return o.$$set=N=>{"value"in N&&n(0,r=N.value),"additionalConfig"in N&&n(3,c=N.additionalConfig)},[r,h,b,c,k,A,R]}class Tinymce extends SvelteComponent{constructor(e){super(),init(this,e,instance$l,create_fragment$l,safe_not_equal,{value:0,additionalConfig:3,insertMedia:4})}get insertMedia(){return this.$$.ctx[4]}}function get_each_context$7(o,e,n){const r=o.slice();return r[14]=e[n],r}function get_each_context_1$2(o,e,n){const r=o.slice();return r[17]=e[n],r}function create_else_block$7(o){let e,n;return e=new Dropdown({props:{$$slots:{button:[create_button_slot],default:[create_default_slot
2024-08-22 17:59:06 +03:00
`){[e,n]=clip(this,e,n);let c="";for(let u=0,h=0;u<=n&&h<this.text.length;h++){let p=this.text[h],b=u+p.length;u>e&&h&&(c+=r),e<b&&n>u&&(c+=p.slice(Math.max(0,e-u),n-u)),u=b+1}return c}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],c=-1;for(let u of e)r.push(u),c+=u.length+1,r.length==32&&(n.push(new TextLeaf(r,c)),r=[],c=-1);return c>-1&&n.push(new TextLeaf(r,c)),n}}class TextNode extends Text{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,c){for(let u=0;;u++){let h=this.children[u],p=c+h.length,b=r+h.lines-1;if((n?b:p)>=e)return h.lineInner(e,n,r,c);c=p+1,r=b+1}}decompose(e,n,r,c){for(let u=0,h=0;h<=n&&u<this.children.length;u++){let p=this.children[u],b=h+p.length;if(e<=b&&n>=h){let y=c&((h<=e?1:0)|(b>=n?2:0));h>=e&&b<=n&&!y?r.push(p):p.decompose(e-h,n-h,r,y)}h=b+1}}replace(e,n,r){if([e,n]=clip(this,e,n),r.lines<this.lines)for(let c=0,u=0;c<this.children.length;c++){let h=this.children[c],p=u+h.length;if(e>=u&&n<=p){let b=h.replace(e-u,n-u,r),y=this.lines-h.lines+b.lines;if(b.lines<y>>4&&b.lines>y>>6){let k=this.children.slice();return k[c]=b,new TextNode(k,this.length-(n-e)+r.length)}return super.replace(u,p,b)}u=p+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
`){[e,n]=clip(this,e,n);let c="";for(let u=0,h=0;u<this.children.length&&h<=n;u++){let p=this.children[u],b=h+p.length;h>e&&u&&(c+=r),e<b&&n>h&&(c+=p.sliceString(e-h,n-h,r)),h=b+1}return c}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof TextNode))return 0;let r=0,[c,u,h,p]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;c+=n,u+=n){if(c==h||u==p)return r;let b=this.children[c],y=e.children[u];if(b!=y)return r+b.scanIdentical(y,n);r+=b.length+1}}static from(e,n=e.reduce((r,c)=>r+c.length+1,-1)){let r=0;for(let N of e)r+=N.lines;if(r<32){let N=[];for(let F of e)F.flatten(N);return new TextLeaf(N,n)}let c=Math.max(32,r>>5),u=c<<1,h=c>>1,p=[],b=0,y=-1,k=[];function A(N){let F;if(N.lines>u&&N instanceof TextNode)for(let V of N.children)A(V);else N.lines>h&&(b>h||!b)?(R(),p.push(N)):N instanceof TextLeaf&&b&&(F=k[k.length-1])instanceof TextLeaf&&N.lines+F.lines<=32?(b+=N.lines,y+=N.length+1,k[k.length-1]=new TextLeaf(F.text.concat(N.text),F.length+1+N.length)):(b+N.lines>c&&R(),b+=N.lines,y+=N.length+1,k.push(N))}function R(){b!=0&&(p.push(k.length==1?k[0]:TextNode.from(k,y)),y=-1,b=k.length=0)}for(let N of e)A(N);return R(),p.length==1?p[0]:new TextNode(p,n)}}Text.empty=new TextLeaf([""],0);function textLength(o){let e=-1;for(let n of o)e+=n.length+1;return e}function appendText(o,e,n=0,r=1e9){for(let c=0,u=0,h=!0;u<o.length&&c<=r;u++){let p=o[u],b=c+p.length;b>=n&&(b>r&&(p=p.slice(0,r-c)),c<n&&(p=p.slice(n-c)),h?(e[e.length-1]+=p,h=!1):e.push(p)),c=b+1}return e}function sliceText(o,e,n){return appendText(o,[""],e,n)}class RawTextCursor{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof TextLeaf?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,c=this.nodes[r],u=this.offsets[r],h=u>>1,p=c instanceof TextLeaf?c.text.length:c.children.length;if(h==(n>0?p:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((u&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(c instanceof TextLeaf){let b=c.text[h+(n<0?-1:0)];if(this.offsets[r]+=n,b.length>Math.max(0,e))return this.value=e==0?b:n>0?b.slice(e):b.slice(0,b.length-e),this;e-=b.length}else{let b=c.children[h+(n<0?-1:0)];e>b.length?(e-=b.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(b),this.offsets.push(n>0?1:(b instanceof TextLeaf?b.text.length:b.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class PartialTextCursor{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new RawTextCursor(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:c}=this.cursor.next(e);return this.pos+=(c.length+e)*n,this.value=c.length<=r?c:n<0?c.slice(c.length-r):c.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:c}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=c,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});let Line$1=class{constructor(e,n,r,c){this.from=e,this.to=n,this.number=r,this.text=c}get length(){return this.to-this.from}};function clip(o,e,n){return e=Math.max(0,Math.min(o.length,e)),[e,Math.max(e,Math.min(o.length,n))]}let extend="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(o=>o?parseInt(o,36):1);for(let o=1;o<extend.length;o++)extend[o]+=extend[o-1];function isExtendingChar(o){for(let e=1;e<extend.length;e+=2)if(extend[e]>o)return extend[e-1]<=o;return!1}function isRegionalIndicator(o){return o>=127462&&o<=127487}const ZWJ=8205;function findClusterBreak(o,e,n=!0,r=!0){return(n?nextClusterBreak:prevClusterBreak)(o,e,r)}function nextClusterBreak(o,e,n){if(e==o.length)return e;e&&surrogateLow(o.charCodeAt(e))&&surrogateHigh(o.charCodeAt(e-1))&&e--;let r=codePointAt(o,e);for(e+=codePointSize(r);e<o.length;){let c=codePointAt(o,e);if(r==ZWJ||c==ZWJ||n&&isExtendingChar(c))e+=codePointSize(c),r=c;else if(isRegionalIndicator(c)){let
`}get readOnly(){return this.facet(readOnly)}phrase(e,...n){for(let r of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,c)=>{if(c=="$")return"$";let u=+(c||1);return!u||u>n.length?r:n[u-1]})),e}languageDataAt(e,n,r=-1){let c=[];for(let u of this.facet(languageData))for(let h of u(this,n,r))Object.prototype.hasOwnProperty.call(h,e)&&c.push(h[e]);return c}charCategorizer(e){return makeCategorizer(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:c}=this.doc.lineAt(e),u=this.charCategorizer(e),h=e-r,p=e-r;for(;h>0;){let b=findClusterBreak(n,h,!1);if(u(n.slice(b,h))!=CharCategory.Word)break;h=b}for(;p<c;){let b=findClusterBreak(n,p);if(u(n.slice(p,b))!=CharCategory.Word)break;p=b}return h==p?null:EditorSelection.range(h+r,p+r)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:o=>o.length?o[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(o,e){let n=Object.keys(o),r=Object.keys(e);return n.length==r.length&&n.every(c=>o[c]==e[c])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(o,e,n={}){let r={};for(let c of o)for(let u of Object.keys(c)){let h=c[u],p=r[u];if(p===void 0)r[u]=h;else if(!(p===h||h===void 0))if(Object.hasOwnProperty.call(n,u))r[u]=n[u](p,h);else throw new Error("Config merge conflict for field "+u)}for(let c in e)r[c]===void 0&&(r[c]=e[c]);return r}class RangeValue{eq(e){return this==e}range(e,n=e){return Range$2.create(e,n,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$2=class Dq{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Dq(e,n,r)}};function cmpRange(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class Chunk{constructor(e,n,r,c){this.from=e,this.to=n,this.value=r,this.maxPoint=c}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,c=0){let u=r?this.to:this.from;for(let h=c,p=u.length;;){if(h==p)return h;let b=h+p>>1,y=u[b]-e||(r?this.value[b].endSide:this.value[b].startSide)-n;if(b==h)return y>=0?h:p;y>=0?p=b:h=b+1}}between(e,n,r,c){for(let u=this.findIndex(n,-1e9,!0),h=this.findIndex(r,1e9,!1,u);u<h;u++)if(c(this.from[u]+e,this.to[u]+e,this.value[u])===!1)return!1}map(e,n){let r=[],c=[],u=[],h=-1,p=-1;for(let b=0;b<this.value.length;b++){let y=this.value[b],k=this.from[b]+e,A=this.to[b]+e,R,N;if(k==A){let F=n.mapPos(k,y.startSide,y.mapMode);if(F==null||(R=N=F,y.startSide!=y.endSide&&(N=n.mapPos(k,y.endSide),N<R)))continue}else if(R=n.mapPos(k,y.startSide),N=n.mapPos(A,y.endSide),R>N||R==N&&y.startSide>0&&y.endSide<=0)continue;(N-R||y.endSide-y.startSide)<0||(h<0&&(h=R),y.point&&(p=Math.max(p,N-R)),r.push(y),c.push(R-h),u.push(N-h))}return{mapped:r.length?new Chunk(c,u,r,p):null,pos:h}}}class RangeSet{constructor(e,n,r,c){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=c}static create(e,n,r,c){return new RangeSet(e,n,r,c)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:c=0,filterTo:u=this.length}=e,h=e.filter;if(n.length==0&&!h)return this;if(r&&(n=n.slice().sort(cmpRange)),this.isEmpty)return n.length?RangeSet.of(n):this;let p=new LayerCursor(this,null,-1).goto(0),b=0,y=[],k=new RangeSetBuilder;for(;p.value||b<n.length;)if(b<n.length&&(p.from-n[b].from||p.startSide-n[b].value.startSide)>=0){let A=n[b++];k.addInner(A.from,A.to,A.value)||y.push(A)}else p.rangeIndex==1&&p.chunkIndex<this.chunk.length&&(b==n.length||this.chunkEnd(p
`)}static newName(){let e=top[COUNT]||1;return top[COUNT]=e+1,C+e.toString(36)}static mount(e,n,r){let c=e[SET],u=r&&r.nonce;c?u&&c.setNonce(u):c=new StyleSet(e,u),c.mount(Array.isArray(n)?n:[n],e)}}let adoptedSet=new Map;class StyleSet{constructor(e,n){let r=e.ownerDocument||e,c=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&c.CSSStyleSheet){let u=adoptedSet.get(r);if(u)return e[SET]=u;this.sheet=new c.CSSStyleSheet,adoptedSet.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[SET]=this}mount(e,n){let r=this.sheet,c=0,u=0;for(let h=0;h<e.length;h++){let p=e[h],b=this.modules.indexOf(p);if(b<u&&b>-1&&(this.modules.splice(b,1),u--,b=-1),b==-1){if(this.modules.splice(u++,0,p),r)for(let y=0;y<p.rules.length;y++)r.insertRule(p.rules[y],c++)}else{for(;u<b;)c+=this.modules[u++].rules.length;c+=p.rules.length,u++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let h="";for(let b=0;b<this.modules.length;b++)h+=this.modules[b].getRules()+`
`;this.styleTag.textContent=h;let p=n.head||n;this.styleTag.parentNode!=p&&p.insertBefore(this.styleTag,p.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(o){var e=mac&&o.metaKey&&o.shiftKey&&!o.ctrlKey&&!o.altKey||ie$1&&o.shiftKey&&o.key&&o.key.length==1||o.key=="Unidentified",n=!e&&o.key||(o.shiftKey?shift:base)[o.keyCode]||o.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function getSelection(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function contains(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function deepActiveElement(o){let e=o.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function hasSelection(o,e){if(!e.anchorNode)return!1;try{return contains(o,e.anchorNode)}catch{return!1}}function clientRectsFor(o){return o.nodeType==3?textRange(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function isEquivalentPosition(o,e,n,r){return n?scanFor(o,e,n,r,-1)||scanFor(o,e,n,r,1):!1}function domIndex(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function isBlockElement(o){return o.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(o.nodeName)}function scanFor(o,e,n,r,c){for(;;){if(o==n&&e==r)return!0;if(e==(c<0?0:maxOffset(o))){if(o.nodeName=="DIV")return!1;let u=o.parentNode;if(!u||u.nodeType!=1)return!1;e=domIndex(o)+(c<0?0:1),o=u}else if(o.nodeType==1){if(o=o.childNodes[e+(c<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=c<0?maxOffset(o):0}else return!1}}function maxOffset(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}function flattenRect(o,e){let n=e?o.left:o.right;return{left:n,right:n,top:o.top,bottom:o.bottom}}function windowRect(o){let e=o.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function getScale(o,e){let n=e.width/o.offsetWidth,r=e.height/o.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-o.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-o.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function scrollRectIntoView(o,e,n,r,c,u,h,p){let b=o.ownerDocument,y=b.defaultView||window;for(let k=o,A=!1;k&&!A;)if(k.nodeType==1){let R,N=k==b.body,F=1,V=1;if(N)R=windowRect(y);else{if(/^(fixed|sticky)$/.test(getComputedStyle(k).position)&&(A=!0),k.scrollHeight<=k.clientHeight&&k.scrollWidth<=k.clientWidth){k=k.assignedSlot||k.parentNode;continue}let te=k.getBoundingClientRect();({scaleX:F,scaleY:V}=getScale(k,te)),R={left:te.left,right:te.left+k.clientWidth*F,top:te.top,bottom:te.top+k.clientHeight*V}}let W=0,J=0;if(c=="nearest")e.top<R.top?(J=-(R.top-e.top+h),n>0&&e.botto
`,c=o.state.doc.line(c.number+(n?1:-1)),u=o.bidiSpans(c),y=o.visualLineSide(c,!n)}if(b){if(!b(k))return p}else{if(!r)return y;b=r(k)}p=y}}function byGroup(o,e,n){let r=o.state.charCategorizer(e),c=r(n);return u=>{let h=r(u);return c==CharCategory.Space&&(c=h),c==h}}function moveVertically(o,e,n,r){let c=e.head,u=n?1:-1;if(c==(n?o.state.doc.length:0))return EditorSelection.cursor(c,e.assoc);let h=e.goalColumn,p,b=o.contentDOM.getBoundingClientRect(),y=o.coordsAtPos(c,e.assoc||-1),k=o.documentTop;if(y)h==null&&(h=y.left-b.left),p=u<0?y.top:y.bottom;else{let N=o.viewState.lineBlockAt(c);h==null&&(h=Math.min(b.right-b.left,o.defaultCharacterWidth*(c-N.from))),p=(u<0?N.top:N.bottom)+k}let A=b.left+h,R=r??o.viewState.heightOracle.textHeight>>1;for(let N=0;;N+=10){let F=p+(R+N)*u,V=posAtCoords(o,{x:A,y:F},!1,u);if(F<b.top||F>b.bottom||(u<0?V<c:V>c)){let W=o.docView.coordsForChar(V),J=!W||F<W.top?-1:1;return EditorSelection.cursor(V,J,void 0,h)}}}function skipAtomicRanges(o,e,n){for(;;){let r=0;for(let c of o)c.between(e-1,e+1,(u,h,p)=>{if(e>u&&e<h){let b=r||n||(e-u<h-e?-1:1);e=b<0?u:h,r=b}});if(!r)return e}}function skipAtoms(o,e,n){let r=skipAtomicRanges(o.state.facet(atomicRanges).map(c=>c(o)),n.from,e.head>n.from?-1:1);return r==n.from?n:EditorSelection.cursor(r,r<n.from?1:-1)}const LineBreakPlaceholder="￿";class DOMReader{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(EditorState.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=LineBreakPlaceholder}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let c=e;;){this.findPointBefore(r,c);let u=this.text.length;this.readNode(c);let h=c.nextSibling;if(h==n)break;let p=ContentView.get(c),b=ContentView.get(h);(p&&b?p.breakAfter:(p?p.breakAfter:isBlockElement(c))||isBlockElement(h)&&(c.nodeName!="BR"||c.cmIgnore)&&this.text.length>u)&&this.lineBreak(),c=h}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,c=this.lineSeparator?null:/\r\n?|\n/g;;){let u=-1,h=1,p;if(this.lineSeparator?(u=n.indexOf(this.lineSeparator,r),h=this.lineSeparator.length):(p=c.exec(n))&&(u=p.index,h=p[0].length),this.append(n.slice(r,u<0?n.length:u)),u<0)break;if(this.lineBreak(),h>1)for(let b of this.points)b.node==e&&b.pos>this.text.length&&(b.pos-=h-1);r=u+h}}readNode(e){if(e.cmIgnore)return;let n=ContentView.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let c=r.iter();!c.next().done;)c.lineBreak?this.lineBreak():this.append(c.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(isAtEnd(e,r.node,r.offset)?n:0))}}function isAtEnd(o,e,n){for(;;){if(!e||n<maxOffset(e))return!1;if(e==o)return!0;n=domIndex(e)+1,e=e.parentNode}}class DOMPoint{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class DOMChange{constructor(e,n,r,c){this.typeOver=c,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:u,impreciseAnchor:h}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let p=u||h?[]:selectionPoints(e),b=new DOMReader(p,e.state);b.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=b.text,this.newSel=selectionFromPoints(p,this.bounds.from)}else{let p=e.observer.selectionRange,b=u&&u.node==p.focusNode&&u.offset==p.focusOffset||!contains(e.contentDOM,p.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(p.focusNode,p.focusOffset),y=h&&h.node==p.anchorNode&&h.offset==p.anchorOffset||!contains(e.contentDOM,p.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(p.anchorNode,p.anchorOffset),k=e.viewport;if((browser.ios||browser.chrome)&&e.state.selection.main.empty&&b!=y&&(k.from>0||k.to<e.state.doc.leng
`&&o.lineWrapping&&(r&&(r=EditorSelection.single(r.main.anchor-1,r.main.head-1)),n={from:c.from,to:c.to,insert:Text.of([" "])}),n)return applyDOMChangeInner(o,n,r,u);if(r&&!r.main.eq(c)){let h=!1,p="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(h=!0),p=o.inputState.lastSelectionOrigin),o.dispatch({selection:r,scrollIntoView:h,userEvent:p}),!0}else return!1}function applyDOMChangeInner(o,e,n,r=-1){if(browser.ios&&o.inputState.flushIOSKey(e))return!0;let c=o.state.selection.main;if(browser.android&&(e.to==c.to&&(e.from==c.from||e.from==c.from-1&&o.state.sliceDoc(e.from,c.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&dispatchKey(o.contentDOM,"Enter",13)||(e.from==c.from-1&&e.to==c.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>c.head)&&dispatchKey(o.contentDOM,"Backspace",8)||e.from==c.from&&e.to==c.to+1&&e.insert.length==0&&dispatchKey(o.contentDOM,"Delete",46)))return!0;let u=e.insert.toString();o.inputState.composing>=0&&o.inputState.composing++;let h,p=()=>h||(h=applyDefaultInsert(o,e,n));return o.state.facet(inputHandler$1).some(b=>b(o,e.from,e.to,u,p))||o.dispatch(p()),!0}function applyDefaultInsert(o,e,n){let r,c=o.state,u=c.selection.main;if(e.from>=u.from&&e.to<=u.to&&e.to-e.from>=(u.to-u.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&o.inputState.composing<0){let p=u.from<e.from?c.sliceDoc(u.from,e.from):"",b=u.to>e.to?c.sliceDoc(e.to,u.to):"";r=c.replaceSelection(o.state.toText(p+e.insert.sliceString(0,void 0,o.state.lineBreak)+b))}else{let p=c.changes(e),b=n&&n.main.to<=p.newLength?n.main:void 0;if(c.selection.ranges.length>1&&o.inputState.composing>=0&&e.to<=u.to&&e.to>=u.to-10){let y=o.state.sliceDoc(e.from,e.to),k,A=n&&findCompositionNode(o,n.main.head);if(A){let F=e.insert.length-(e.to-e.from);k={from:A.from,to:A.to-F}}else k=o.state.doc.lineAt(u.head);let R=u.to-e.to,N=u.to-u.from;r=c.changeByRange(F=>{if(F.from==u.from&&F.to==u.to)return{changes:p,range:b||F.map(p)};let V=F.to-R,W=V-y.length;if(F.to-F.from!=N||o.state.sliceDoc(W,V)!=y||F.to>=k.from&&F.from<=k.to)return{range:F};let J=c.changes({from:W,to:V,insert:e.insert}),te=F.to-u.to;return{changes:J,range:b?EditorSelection.range(Math.max(0,b.anchor+te),Math.max(0,b.head+te)):F.map(J)}})}else r={changes:p,selection:b&&c.selection.replaceRange(b)}}let h="input.type";return(o.composing||o.inputState.compositionPendingChange&&o.inputState.compositionEndedAt>Date.now()-50)&&(o.inputState.compositionPendingChange=!1,h+=".compose",o.inputState.compositionFirstChange&&(h+=".start",o.inputState.compositionFirstChange=!1)),c.update(r,{userEvent:h,scrollIntoView:!0})}function findDiff(o,e,n,r){let c=Math.min(o.length,e.length),u=0;for(;u<c&&o.charCodeAt(u)==e.charCodeAt(u);)u++;if(u==c&&o.length==e.length)return null;let h=o.length,p=e.length;for(;h>0&&p>0&&o.charCodeAt(h-1)==e.charCodeAt(p-1);)h--,p--;if(r=="end"){let b=Math.max(0,u-Math.min(h,p));n-=h+b-u}if(h<u&&o.length<e.length){let b=n<=u&&n>=h?u-n:0;u-=b,p=u+(p-h),h=u}else if(p<u){let b=n<=u&&n>=p?u-n:0;u-=b,h=u+(h-p),p=u}return{from:u,toA:h,toB:p}}function selectionPoints(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:c,focusOffset:u}=o.observer.selectionRange;return n&&(e.push(new DOMPoint(n,r)),(c!=n||u!=r)&&e.push(new DOMPoint(c,u))),e}function selectionFromPoints(o,e){if(o.length==0)return null;let n=o[0].pos,r=o.length==2?o[1].pos:n;return n>-1&&r>-1?EditorSelection.single(n+e,r+e):null}class InputState{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange
2024-08-23 18:15:18 +03:00
`))};u.from==this.from&&c<this.from?u.from=c:u.to==this.to&&c>this.to&&(u.to=c),!(u.from==u.to&&!u.insert.length)&&(this.pendingContextChange=u,e.state.readOnly||applyDOMChangeInner(e,u,EditorSelection.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let c=[],u=null;for(let h=this.toEditorPos(r.rangeStart),p=this.toEditorPos(r.rangeEnd);h<p;h++){let b=e.coordsForChar(h);u=b&&new DOMRect(b.left,b.top,b.right-b.left,b.bottom-b.top)||u||new DOMRect,c.push(u)}n.updateCharacterBounds(r.rangeStart,c)},this.handlers.textformatupdate=r=>{let c=[];for(let u of r.getTextFormats()){let h=u.underlineStyle,p=u.underlineThickness;if(h!="None"&&p!="None"){let b=`text-decoration: underline ${h=="Dashed"?"dashed ":h=="Squiggle"?"wavy ":""}${p=="Thin"?1:2}px`;c.push(Decoration.mark({attributes:{style:b}}).range(this.toEditorPos(u.rangeStart),this.toEditorPos(u.rangeEnd)))}}e.dispatch({effects:setEditContextFormatting.of(Decoration.set(c))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let c=getSelection(r.root);c&&c.rangeCount&&this.editContext.updateSelectionBounds(c.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,c=this.pendingContextChange;return e.changes.iterChanges((u,h,p,b,y)=>{if(r)return;let k=y.length-(h-u);if(c&&h>=c.to)if(c.from==u&&c.to==h&&c.insert.eq(y)){c=this.pendingContextChange=null,n+=k,this.to+=k;return}else c=null,this.revertPending(e.state);if(u+=n,h+=n,h<=this.from)this.from+=k,this.to+=k;else if(u<this.to){if(u<this.from||h>this.to||this.to-this.from+y.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(u),this.toContextPos(h),y.toString()),this.to+=k}n+=k}),c&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),c=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=c)&&this.editContext.updateSelection(r,c)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.co
--Ÿ­؜\u2028\u2029\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var o;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let e=document.body.style;_supportsTabSize=((o=e.tabSize)!==null&&o!==void 0?o:e.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(o){let e=combineConfig(o,{render:null,specialChars:Specials,addSpecialChars:null});return(e.replaceTabs=!supportsTabSize())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,UnicodeRegexpSupport)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,UnicodeRegexpSupport)),e}});function highlightSpecialChars(o={}){return[specialCharConfig.of(o),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(o.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(o)}makeDecorator(o){return new MatchDecorator({regexp:o.specialChars,decoration:(e,n,r)=>{let{doc:c}=n.state,u=codePointAt(e[0],0);if(u==9){let h=c.lineAt(r),p=n.state.tabSize,b=countColumn(h.text,p,r-h.from);return Decoration.replace({widget:new TabWidget((p-b%p)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[u]||(this.decorationCache[u]=Decoration.replace({widget:new SpecialCharWidget(o,u)}))},boundary:o.replaceTabs?void 0:/[^]/})}update(o){let e=o.state.facet(specialCharConfig);o.startState.facet(specialCharConfig)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(o.view)):this.decorations=this.decorator.updateDeco(o,this.decorations)}},{decorations:o=>o.decorations}))}const DefaultPlaceholder="•";function placeholder$1(o){return o>=32?DefaultPlaceholder:o==10?"␤":String.fromCharCode(9216+o)}class SpecialCharWidget extends WidgetType{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=placeholder$1(this.code),r=e.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),c=this.options.render&&this.options.render(this.code,r,n);if(c)return c;let u=document.createElement("span");return u.textContent=n,u.title=r,u.setAttribute("aria-label",r),u.className="cm-specialChar",u}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.docChanged||o.selectionSet)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=-1,n=[];for(let r of o.state.selection.ranges){let c=o.lineBlockAt(r.head);c.from>e&&(n.push(lineDeco.range(c.from)),e=c.from)}return Decoration.set(n)}},{decorations:o=>o.decorations}),MaxOff=2e3;function rectangleFor(o,e,n){let r=Math.min(e.line,n.line),c=Math.max(e.line,n.line),u=[];if(e.off>MaxOff||n.off>MaxOff||e.col<0||n.col<0){let h=Math.min(e.off,n.off),p=Math.max(e.off,n.off);for(let b=r;b<=c;b++){let y=o.doc.line(b);y.length<=p&&u.push(EditorSelection.range(y.from+h,y.to+p))}}else{let h=Math.min(e.col,n.col),p=Math.max(e.col,n.col);for(let b=r;b<=c;b++){let
2024-08-22 17:59:06 +03:00
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(e,n=0,r){let c=e.doc?e:EditorState.create({doc:e});return r==null&&(r=c.doc.length),this.regexp?regexpCursor(this,c,n,r):stringCursor(this,c,n,r)}}class QueryType{constructor(e){this.spec=e}}function stringCursor(o,e,n,r){return new SearchCursor(e.doc,o.unquoted,n,r,o.caseSensitive?void 0:c=>c.toLowerCase(),o.wholeWord?stringWordTest(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function stringWordTest(o,e){return(n,r,c,u)=>((u>n||u+c.length<r)&&(u=Math.max(0,n-2),c=o.sliceString(u,Math.min(o.length,r+2))),(e(charBefore(c,n-u))!=CharCategory.Word||e(charAfter(c,n-u))!=CharCategory.Word)&&(e(charAfter(c,r-u))!=CharCategory.Word||e(charBefore(c,r-u))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(e){super(e)}nextMatch(e,n,r){let c=stringCursor(this.spec,e,r,e.doc.length).nextOverlapping();return c.done&&(c=stringCursor(this.spec,e,0,n).nextOverlapping()),c.done?null:c.value}prevMatchInRange(e,n,r){for(let c=r;;){let u=Math.max(n,c-1e4-this.spec.unquoted.length),h=stringCursor(this.spec,e,u,c),p=null;for(;!h.nextOverlapping().done;)p=h.value;if(p)return p;if(u==n)return null;c-=1e4}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=stringCursor(this.spec,e,0,e.doc.length),c=[];for(;!r.next().done;){if(c.length>=n)return null;c.push(r.value)}return c}highlight(e,n,r,c){let u=stringCursor(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!u.next().done;)c(u.value.from,u.value.to)}}function regexpCursor(o,e,n,r){return new RegExpCursor(e.doc,o.search,{ignoreCase:!o.caseSensitive,test:o.wholeWord?regexpWordTest(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function charBefore(o,e){return o.slice(findClusterBreak(o,e,!1),e)}function charAfter(o,e){return o.slice(e,findClusterBreak(o,e))}function regexpWordTest(o){return(e,n,r)=>!r[0].length||(o(charBefore(r.input,r.index))!=CharCategory.Word||o(charAfter(r.input,r.index))!=CharCategory.Word)&&(o(charAfter(r.input,r.index+r[0].length))!=CharCategory.Word||o(charBefore(r.input,r.index+r[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(e,n,r){let c=regexpCursor(this.spec,e,r,e.doc.length).next();return c.done&&(c=regexpCursor(this.spec,e,0,n).next()),c.done?null:c.value}prevMatchInRange(e,n,r){for(let c=1;;c++){let u=Math.max(n,r-c*1e4),h=regexpCursor(this.spec,e,u,r),p=null;for(;!h.next().done;)p=h.value;if(p&&(u==n||p.from>u+10))return p;if(u==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:n)}matchAll(e,n){let r=regexpCursor(this.spec,e,0,e.doc.length),c=[];for(;!r.next().done;){if(c.length>=n)return null;c.push(r.value)}return c}highlight(e,n,r,c){let u=regexpCursor(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!u.next().done;)c(u.value.from,u.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel$1=StateEffect.define(),searchState=StateField.define({create(o){return new SearchState(defaultQuery(o).create(),null)},update(o,e){for(let n of e.effects)n.is(setSearchQuery)?o=new SearchState(n.value.create(),o.panel):n.is(togglePanel$1)&&(o=new SearchState(o.query,n.value?createSearchPanel:null));return o},provide:o=>showPanel.from(o,e=>e.panel)});class SearchState{constructor(e,n){this.query=e,this.panel=n}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(o){this.view=o,this.decorati
`+n.scrub(),u=this.advance(c);return u>-1&&u<c.length?this.complete(e,r,u):!1}finish(e,n){return(this.stage==2||this.stage==3)&&skipSpace(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,elt(Type.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(parseLinkLabel(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(elt(Type.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(parseURL(e,skipSpace(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=skipSpace(e,this.pos),r=0;if(n>this.pos){let c=parseLinkTitle(e,n,this.start);if(c){let u=lineEnd(e,c.to-this.start);u>0&&(this.nextStage(c),r=u)}}return r||(r=lineEnd(e,this.pos)),r>0&&r<e.length?r:-1}else return lineEnd(e,this.pos)}}}function lineEnd(o,e){for(;e<o.length;e++){let n=o.charCodeAt(e);if(n==10)break;if(!space$2(n))return-1}return e}class SetextHeadingParser{nextLine(e,n,r){let c=n.depth<e.stack.length?-1:isSetextUnderline(n),u=n.next;if(c<0)return!1;let h=elt(Type.HeaderMark,e.lineStart+n.pos,e.lineStart+c);return e.nextLine(),e.addLeafElement(r,elt(u==61?Type.SetextHeading1:Type.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),h])),!0}finish(){return!1}}const DefaultLeafBlocks={LinkReference(o,e){return e.content.charCodeAt(0)==91?new LinkReferenceParser(e):null},SetextHeading(){return new SetextHeadingParser}},DefaultEndLeaf=[(o,e)=>isAtxHeading(e)>=0,(o,e)=>isFencedCode(e)>=0,(o,e)=>isBlockquote(e)>=0,(o,e)=>isBulletList(e,o,!0)>=0,(o,e)=>isOrderedList(e,o,!0)>=0,(o,e)=>isHorizontalRule(e,o,!0)>=0,(o,e)=>isHTMLBlock(e,o,!0)>=0],scanLineResult={text:"",end:0};class BlockContext{constructor(e,n,r,c){this.parser=e,this.input=n,this.ranges=c,this.line=new Line,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=c[c.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=c[0].from,this.block=CompositeBlock.create(Type.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new FragmentCursor(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let c=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!c||e.markers[r].from<c.end);){let u=e.markers[r++];this.addNode(u.type,u.from,u.to)}if(!c)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let c=r(this,e);if(c!=!1){if(c==!0)return null;e.forward();continue e}}break}let n=new LeafBlock(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let c=r(this,n);c&&n.parsers.push(c)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
`+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=toRelative(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=scanLineResult;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,c=this.rangeI;for(;this.ranges[c].to<n.end;){c++;let u=this.ranges[c].from,h=this.lineChunkAt(u);n.end=u+h.length,n.text=n.text.slice(0,this.ranges[c-1].to-r)+h,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let c=this.stack[e.depth],u=this.parser.skipContextMarkup[c.type];if(!u)throw new Error("Unhandled block context "+Type[c.type]);if(!u(c,this,e))break;e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
`?"":n;else{let c=n.indexOf(`
`);r=c<0?n:n.slice(0,c)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=CompositeBlock.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new Tree(this.parser.nodeSet.types[e],none,none,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(injectMarks(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?injectGaps(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=injectMarks(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(Type.Paragraph,e.content.length),e.start)}elt(e,n,r,c){return typeof e=="string"?elt(this.parser.getNodeType(e),n,r,c):new TreeElement(e,n)}get buffer(){return new Buffer$1(this.parser.nodeSet)}}function injectGaps(o,e,n,r,c){let u=o[e].to,h=[],p=[],b=n.from+r;function y(k,A){for(;A?k>=u:k>u;){let R=o[e+1].from-u;r+=R,k+=R,e++,u=o[e].to}}for(let k=n.firstChild;k;k=k.nextSibling){y(k.from+r,!0);let A=k.from+r,R,N=c.get(k.tree);N?R=N:k.to+r>u?(R=injectGaps(o,e,k,r,c),y(k.to+r,!1)):R=k.toTree(),h.push(R),p.push(A-b)}return y(n.to+r,!1),new Tree(n.type,h,p,n.to+r-b,n.tree?n.tree.propValues:void 0)}class MarkdownParser extends Parser{constructor(e,n,r,c,u,h,p,b,y){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=c,this.endLeafBlock=u,this.skipContextMarkup=h,this.inlineParsers=p,this.inlineNames=b,this.wrappers=y,this.nodeTypes=Object.create(null);for(let k of e.types)this.nodeTypes[k.name]=k.id}createParse(e,n,r){let c=new BlockContext(this,e,n,r);for(let u of this.wrappers)c=u(c,e,n,r);return c}configure(e){let n=resolveConfig(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:c}=this,u=this.blockParsers.slice(),h=this.leafBlockParsers.slice(),p=this.blockNames.slice(),b=this.inlineParsers.slice(),y=this.inlineNames.slice(),k=this.endLeafBlock.slice(),A=this.wrappers;if(nonEmpty(n.defineNodes)){c=Object.assign({},c);let R=r.types.slice(),N;for(let F of n.defineNodes){let{name:V,block:W,composite:J,style:te}=typeof F=="string"?{name:F}:F;if(R.some(fe=>fe.name==V))continue;J&&(c[R.length]=(fe,_e,ne)=>J(_e,ne,fe.value));let j=R.length,ae=J?["Block","BlockContext"]:W?j>=Type.ATXHeading1&&j<=Type.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;R.push(NodeType.define({id:j,name:V,props:ae&&[[NodeProp.group,ae]]})),te&&(N||(N={}),Array.isArray(te)||te instanceof Tag?N[V]=te:Object.assign(N,te))}r=new NodeSet(R),N&&(r=r.extend(styleTags(N)))}if(nonEmpty(n.props)&&(r=r.extend(...n.props)),nonEmpty(n.remove))for(let R of n.remove){let N=this.blockNames.indexOf(R),F=this.inlineNames.indexOf(R);N>-1&&(u[N]=h[N]=void 0),F>-1&&(b[F]=void 0)}if(nonEmpty(n.parseBlock))for(let R of n.parseBlock){let N=p.indexOf(R.name);if(N>-1)u[N]=R.parse,h[N]=R.leaf;else{let F=R.before?findName(p,R.before):R.after?findName(p,R.after)+1:p.length-1;u.splice(F,0,R.parse),h.splice(F,0,R.leaf),p.splice(F,0,R.name)}R.endLeaf&&k.push(R.endLeaf)}if(nonEmpty(n.parseInline))for(let R of n.parseInline){let N=y.indexOf(R.name);if(N>-1)b[N]=R.parse;else{let F=R.before?findName(y,R.before):R.after?findName(y,R.after)+1:y.length-1;b.splice(F,0,R.parse),y.splice(F,0,R.name)}}return n.wrap&&(A=A.concat(n.wrap)),new MarkdownParser(r,u,h,p,k,c,b,y,A)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)thro
`;)u--;this.fragmentEnd=u?u-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let c=e+this.fragment.offset;for(;r.to<=c;)if(!r.parent())return!1;for(;;){if(r.from>=c)return this.fragment.from<=n;if(!r.childAfter(c))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(NodeProp.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,c=this.fragmentEnd-(this.fragment.openEnd?1:0),u=e.absoluteLineStart,h=u,p=e.block.children.length,b=h,y=p;for(;;){if(n.to-r>c){if(n.type.isAnonymous&&n.firstChild())continue;break}let k=toRelative(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,k);else{let A=new Tree(e.parser.nodeSet.types[Type.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(A,n.tree),e.addNode(A,k)}if(n.type.is("Block")&&(NotLast.indexOf(n.type.id)<0?(h=n.to-r,p=e.block.children.length):(h=b,p=y,b=n.to-r,y=e.block.children.length)),!n.nextSibling())break}for(;e.block.children.length>p;)e.block.children.pop(),e.block.positions.pop();return h-u}}function toRelative(o,e){let n=o;for(let r=1;r<e.length;r++){let c=e[r-1].to,u=e[r].from;c<o&&(n-=u-c)}return n}const markdownHighlighting=styleTags({"Blockquote/...":tags$1.quote,HorizontalRule:tags$1.contentSeparator,"ATXHeading1/... SetextHeading1/...":tags$1.heading1,"ATXHeading2/... SetextHeading2/...":tags$1.heading2,"ATXHeading3/...":tags$1.heading3,"ATXHeading4/...":tags$1.heading4,"ATXHeading5/...":tags$1.heading5,"ATXHeading6/...":tags$1.heading6,"Comment CommentBlock":tags$1.comment,Escape:tags$1.escape,Entity:tags$1.character,"Emphasis/...":tags$1.emphasis,"StrongEmphasis/...":tags$1.strong,"Link/... Image/...":tags$1.link,"OrderedList/... BulletList/...":tags$1.list,"BlockQuote/...":tags$1.quote,"InlineCode CodeText":tags$1.monospace,"URL Autolink":tags$1.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":tags$1.processingInstruction,"CodeInfo LinkLabel":tags$1.labelName,LinkTitle:tags$1.string,Paragraph:tags$1.content}),parser$3=new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting),Object.keys(DefaultBlockParsers).map(o=>DefaultBlockParsers[o]),Object.keys(DefaultBlockParsers).map(o=>DefaultLeafBlocks[o]),Object.keys(DefaultBlockParsers),DefaultEndLeaf,DefaultSkipMarkup,Object.keys(DefaultInline).map(o=>DefaultInline[o]),Object.keys(DefaultInline),[]);function leftOverSpace(o,e,n){let r=[];for(let c=o.firstChild,u=e;;c=c.nextSibling){let h=c?c.from:n;if(h>u&&r.push({from:u,to:h}),!c)break;u=c.to}return r}function parseCode(o){let{codeParser:e,htmlParser:n}=o;return{wrap:parseMixed((c,u)=>{let h=c.type.id;if(e&&(h==Type.CodeBlock||h==Type.FencedCode)){let p="";if(h==Type.FencedCode){let y=c.node.getChild(Type.CodeInfo);y&&(p=u.read(y.from,y.to))}let b=e(p);if(b)return{parser:b,overlay:y=>y.type.id==Type.CodeText}}else if(n&&(h==Type.HTMLBlock||h==Type.HTMLTag))return{parser:n,overlay:leftOverSpace(c.node,c.from,c.to)};return null})}}const StrikethroughDelim={resolve:"Strikethrough",mark:"StrikethroughMark"},Strikethrough={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":tags$1.strikethrough}},{name:"StrikethroughMark",style:tags$1.processingInstruction}],parseInline:[{name:"Strikethrough",parse(o,e,n){if(e!=126||o.char(n+1)!=126||o.char(n+2)==126)return-1;let r=o.slice(n-1,n),c=o.slice(n+2,n+3),u=/\s|^$/.test(r),h=/\s|^$/.test(c),p=Punctuation.test(r),b=Punctuation.test(c);return o.addDelimiter(StrikethroughDelim,n,n+2,!h&&(!b||u||p),!u&&(!p||h||b))},after:"Emphasis"}]};function parseRow(o,e,n=0,r,c=0){let u=0,h=!0,p=-1,b=-1,y=!1,k=()=>{r.push(o.elt("TableCell",c+p,c+b,o.parser.parseInline(e.slice(p,b),c+p)))};for(let A=n;A<e.length;A++){let R=e.charCodeAt(A);R==124&&!y?((!h||p>-1)&&u++,h=!1,r&&(p>-1&&k(),r.push(o.elt("TableDelimiter",A+c,A+c+1))),p=b=-1):(y||R!=32&&R!=9)&&(p<0&&(p=A),b=A+1),y=!y&&R==92}return p>-1&&(u++,r&&k()),u}function hasPipe(o,e){for(let n=e;n<o.length;n++){let r=o.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const delimiterLine=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class TableParser{constructor()
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),snippetCompletion("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),snippetCompletion(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),snippetCompletion(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),snippetCompletion('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),snippetCompletion('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],typescriptSnippets=snippets.concat([snippetCompletion("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),snippetCompletion("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),snippetCompletion("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),cache=new NodeWeakMap,ScopeNodes=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function defID(o){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,o),!0}}const functionContext=["FunctionDeclaration"],gatherCompletions={FunctionDeclaration:defID("function"),ClassDeclaration:defID("class"),ClassExpression:()=>!0,EnumDeclaration:defID("constant"),TypeAliasDeclaration:defID("type"),NamespaceDeclaration:defID("namespace"),VariableDefinition(o,e){o.matchContext(functionContext)||e(o,"variable")},TypeDefinition(o,e){e(o,"type")},__proto__:null};function getScope(o,e){let n=cache.get(e);if(n)return n;let r=[],c=!0;function u(h,p){let b=o.sliceString(h.from,h.to);r.push({label:b,type:p})}return e.cursor(IterMode.IncludeAnonymous).iterate(h=>{if(c)c=!1;else if(h.name){let p=gatherCompletions[h.name];if(p&&p(h,u)||ScopeNodes.has(h.name))return!1}else if(h.to-h.from>8192){for(let p of getScope(o,h.node))r.push(p);return!1}}),cache.set(e,r),r}const Identifier=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dontComplete=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function localCompletionSource(o){let e=syntaxTree(o.state).resolveInner(o.pos,-1);if(dontComplete.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Identifier.test(o.state.sliceDoc(e.from,e.to));if(!n&&!o.explicit)return null;let r=[];for(let c=e;c;c=c.parent)ScopeNodes.has(c.name)&&(r=r.concat(getScope(o.state.doc,c)));return{options:r,from:n?e.from:o.pos,validFor:Identifier}}const javascriptLanguage=LRLanguage.define({name:"javascript",parser:parser.configure({props:[indentNodeProp.add({IfStatement:continuedIndent({except:/^\s*({|else\b)/}),TryStatement:continuedIndent({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:flatIndent,SwitchBody:o=>{let e=o.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return o.baseIndent+(n?0:r?1:2)*o.unit},Block:delimitedIndent({closing:"}"}),ArrowFunction:o=>o.baseIndent+o.unit,"TemplateString BlockComment":()=>null,"Statement Property":continuedIndent({except:/^{/}),JSXElement(o){let e=/^\s*<\//.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},JSXEscape(o){let e=/\s*\}/.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},"JSXOpenTag JSXSelfClosingTag"(o){return o.column(o.node.from)+o.unit}}),foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":foldInside,BlockComment(o){return{from:o.from+2,to:o.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jsxSublanguage={test:o=>/^JSX/.test(o.name),facet:defineLanguageFacet({commentTokens:{block:{open:"{/*",close:"*/}"}}})},typescriptLanguage=javascriptLanguage.configure({dialect:"ts"},"typescript"),jsxLanguage=javascriptLanguage.configure({dialect:"jsx",props:[sublanguageProp.add(o=>o.isTop?[jsxSublanguage]:void 0)]}),tsxLanguage=javascriptLanguage.configure({dialect:"jsx ts",props:[sublanguageProp.add(o=>o.isTop?[jsxSublanguage]:void 0)]},"typescript");let kwCompletion=o=>({label:o,type:"keyword"});const keywords="break case const continue default delete export extends false finally in insta
2024-08-23 18:15:18 +03:00
`,attr(e,"class","start-typing")},m(n,r){insert$1(n,e,r)},p:noop,d(n){n&&detach(e)}}}function create_each_block_1$1(o,e){let n,r=previewTitle(e[9].schemas,e[24],e[0])+"",c,u,h,p;function b(...k){return e[17](e[24],...k)}function y(...k){return e[18](e[24],...k)}return{key:o,first:null,c(){n=element("div"),c=text(r),u=space$3(),attr(n,"class","reference-tags-option"),attr(n,"role","button"),attr(n,"tabindex","0"),this.first=n},m(k,A){insert$1(k,n,A),append(n,c),append(n,u),h||(p=[listen(n,"click",b),listen(n,"keypress",y)],h=!0)},p(k,A){e=k,A&65&&r!==(r=previewTitle(e[9].schemas,e[24],e[0])+"")&&set_data(c,r)},d(k){k&&detach(n),h=!1,run_all(p)}}}function create_if_block_1$7(o){let e,n,r,c,u,h;return{c(){e=element("div"),n=text('Add "'),r=text(o[5]),c=text('"'),attr(e,"class","reference-tags-option"),attr(e,"role","button"),attr(e,"tabindex","0")},m(p,b){insert$1(p,e,b),append(e,n),append(e,r),append(e,c),u||(h=[listen(e,"click",o[19]),listen(e,"keypress",o[20])],u=!0)},p(p,b){b&32&&set_data(r,p[5])},d(p){p&&detach(e),u=!1,run_all(h)}}}function create_if_block$9(o){let e,n=[],r=new Map,c,u=ensure_array_like(o[7]);const h=p=>p[3].id;for(let p=0;p<u.length;p+=1){let b=get_each_context$6(o,u,p),y=h(b);r.set(y,n[p]=create_each_block$6(y,b))}return{c(){e=element("div");for(let p=0;p<n.length;p+=1)n[p].c();set_style(e,"display","flex"),set_style(e,"align-items","center"),set_style(e,"gap","4px")},m(p,b){insert$1(p,e,b);for(let y=0;y<n.length;y+=1)n[y]&&n[y].m(e,null);c=!0},p(p,b){b&1664&&(u=ensure_array_like(p[7]),group_outros(),n=update_keyed_each(n,b,h,1,p,u,r,e,outro_and_destroy_block,create_each_block$6,null,get_each_context$6),check_outros())},i(p){if(!c){for(let b=0;b<u.length;b+=1)transition_in(n[b]);c=!0}},o(p){for(let b=0;b<n.length;b+=1)transition_out(n[b]);c=!1},d(p){p&&detach(e);for(let b=0;b<n.length;b+=1)n[b].d()}}}function create_each_block$6(o,e){let n,r,c=previewTitle(e[9].schemas,e[3])+"",u,h,p,b,y,k,A,R,N;y=new Icon({props:{width:12,height:12,icon:"close"}});function F(...V){return e[21](e[3],...V)}return{key:o,first:null,c(){n=element("span"),r=element("a"),u=text(c),p=space$3(),b=element("button"),create_component(y.$$.fragment),k=space$3(),attr(r,"class","record-title"),attr(r,"href",h=e[9].lucentUrl+"/records/"+e[3].id),attr(b,"type","button"),attr(b,"class","button-text"),attr(b,"aria-label","Close"),attr(n,"class","reference-tags-selected-value"),this.first=n},m(V,W){insert$1(V,n,W),append(n,r),append(r,u),append(n,p),append(n,b),mount_component(y,b,null),append(n,k),A=!0,R||(N=listen(b,"click",prevent_default(F)),R=!0)},p(V,W){e=V,(!A||W&128)&&c!==(c=previewTitle(e[9].schemas,e[3])+"")&&set_data(u,c),(!A||W&128&&h!==(h=e[9].lucentUrl+"/records/"+e[3].id))&&attr(r,"href",h)},i(V){A||(transition_in(y.$$.fragment,V),A=!0)},o(V){transition_out(y.$$.fragment,V),A=!1},d(V){V&&detach(n),destroy_component(y),R=!1,N()}}}function create_fragment$d(o){let e,n,r,c,u,h,p,b,y,k,A,R,N=o[8]&&create_if_block_3$4(o),F=o[6]&&create_if_block_2$4(o),V=o[5]&&create_if_block_1$7(o),W=o[7].length>0&&create_if_block$9(o);return{c(){e=element("div"),N&&N.c(),n=space$3(),r=element("input"),u=space$3(),h=element("div"),F&&F.c(),p=space$3(),V&&V.c(),b=space$3(),W&&W.c(),y=empty$1(),attr(r,"type","search"),attr(r,"id",o[2]),attr(r,"placeholder",c="Search for "+o[1].label),attr(r,"autocomplete","off"),toggle_class(r,"is-invalid",o[8]),attr(h,"class","reference-tags-results"),attr(e,"class","reference-tags")},m(J,te){insert$1(J,e,te),N&&N.m(e,null),append(e,n),append(e,r),o[15](r),set_input_value(r,o[5]),append(e,u),append(e,h),F&&F.m(h,null),append(h,p),V&&V.m(h,null),insert$1(J,b,te),W&&W.m(J,te),insert$1(J,y,te),k=!0,A||(R=[listen(r,"keyup",o[13]),listen(r,"input",o[16])],A=!0)},p(J,[te]){J[8]?N?N.p(J,te):(N=create_if_block_3$4(J),N.c(),N.m(e,n)):N&&(N.d(1),N=null),(!k||te&4)&&attr(r,"id",J[2]),(!k||te&2&&c!==(c="Search for "+J[1].label))&&attr(r,"placeholder",c),te&32&&r.value!==J[5]&&set_input_value(r,J[5]),(!k||te&256)&&toggle_class(r,"is-invalid",J[8]),J[6]?F?F.p(J,te):(F=create_if_block_2$4(J),F.c(),F.m(h,p)):
versions`),rn=space$3(),Fe=element("div"),de.c(),Eo=space$3(),jn=element("div"),Ut&&Ut.c(),attr(u,"class","label text-end text-muted"),attr(R,"class","label text-end text-muted"),attr(te,"class","label text-end text-muted"),attr(Be,"class","label text-end text-muted"),attr(r,"class","col-8"),attr(je,"class","label d-block text-muted "),attr(Le,"class","col-4"),attr(n,"class","row"),attr(e,"class","lx-card "),attr(Fe,"class","revisions")},m(pt,Ne){insert$1(pt,e,Ne),append(e,n),append(n,r),append(r,c),append(c,u),append(c,h),append(c,p),append(p,y),append(r,k),append(r,A),append(A,R),append(A,N),append(A,V),append(r,W),append(r,J),append(J,te),append(J,j),mount_component(ae,J,null),append(J,fe),append(J,ne),append(r,Se),append(r,De),append(De,Be),append(De,Te),mount_component(Oe,De,null),append(De,yt),append(De,St),append(n,q),append(n,Le),append(Le,je),append(Le,mn),append(Le,Rt),append(Rt,Ue),append(Rt,dn),append(Rt,Zt),insert$1(pt,rn,Ne),insert$1(pt,Fe,Ne),cs[mt].m(Fe,null),insert$1(pt,Eo,Ne),insert$1(pt,jn,Ne),Ut&&Ut.m(jn,null),o[13](jn),Yn=!0},p(pt,[Ne]){(!Yn||Ne&1)&&b!==(b=pt[0].id+"")&&set_data(y,b),(!Yn||Ne&1)&&F!==(F=pt[0]._sys.version+"")&&set_data(V,F);const Nt={};Ne&3&&(Nt.name=usernameById(pt[1],pt[0]._sys.createdBy)),ae.$set(Nt),(!Yn||Ne&1)&&_e!==(_e=friendlyDate(pt[0]._sys.createdAt)+"")&&set_data(ne,_e);const pn={};Ne&3&&(pn.name=usernameById(pt[1],pt[0]._sys.updatedBy)),Oe.$set(pn),(!Yn||Ne&1)&&Tt!==(Tt=friendlyDate(pt[0]._sys.updatedAt)+"")&&set_data(St,Tt),(!Yn||Ne&4)&&ct!==(ct=pt[2].revisions+"")&&set_data(dn,ct);let xt=mt;mt=gt(pt),mt===xt?cs[mt].p(pt,Ne):(group_outros(),transition_out(cs[xt],1,1,()=>{cs[xt]=null}),check_outros(),de=cs[mt],de?de.p(pt,Ne):(de=cs[mt]=po[mt](pt),de.c()),transition_in(de,1),de.m(Fe,null)),pt[5]?Ut?(Ut.p(pt,Ne),Ne&32&&transition_in(Ut,1)):(Ut=create_if_block$6(pt),Ut.c(),transition_in(Ut,1),Ut.m(jn,null)):Ut&&(group_outros(),transition_out(Ut,1,1,()=>{Ut=null}),check_outros())},i(pt){Yn||(transition_in(ae.$$.fragment,pt),transition_in(Oe.$$.fragment,pt),transition_in(de),transition_in(Ut),Yn=!0)},o(pt){transition_out(ae.$$.fragment,pt),transition_out(Oe.$$.fragment,pt),transition_out(de),transition_out(Ut),Yn=!1},d(pt){pt&&(detach(e),detach(rn),detach(Fe),detach(Eo),detach(jn)),destroy_component(ae),destroy_component(Oe),cs[mt].d(),Ut&&Ut.d(),o[13](null)}}}function instance$8(o,e,n){let r,c,u,h;const p=getContext$1("channel");let{record:b}=e,{graph:y}=e,{users:k}=e,{schema:A}=e,R,N="";axios.get(`${p.lucentUrl}/records/${b.id}/revisions`).then(j=>{n(8,r=j.data)}).catch(j=>{console.log(j)});function F(j,ae){n(7,h=y.edges.filter(fe=>fe.depth===1).reduce((fe,_e)=>(fe[_e.field]||(fe[_e.field]={record:[],revision:[]}),fe[_e.field].record.push(_e),fe),{})),n(7,h=ae._edges.reduce((fe,_e)=>(fe[_e.field]||(fe[_e.field]={record:[],revision:[]}),fe[_e.field].revision.push(_e),fe),h))}function V(j,ae){j.preventDefault(),n(5,u=ae),n(6,c=A.fields.filter(fe=>!lodashExports.isEqual(u.data[fe.name],b.data[fe.name]))),F(c,ae),R.scrollIntoView()}function W(j){j.preventDefault(),n(4,N=""),axios.post(`${p.lucentUrl}/records/${b.id}/rollback/${u._sys.version}`).then(ae=>{window.location.reload()}).catch(ae=>{const fe=ae.response.data.error;n(4,N=fe.fieldLabel+": "+fe.message)})}const J=(j,ae)=>V(ae,j);function te(j){binding_callbacks[j?"unshift":"push"](()=>{R=j,n(3,R)})}return o.$$set=j=>{"record"in j&&n(0,b=j.record),"graph"in j&&n(11,y=j.graph),"users"in j&&n(1,k=j.users),"schema"in j&&n(2,A=j.schema)},n(8,r=[]),n(6,c=[]),n(5,u=null),n(7,h={}),[b,k,A,R,N,u,c,h,r,V,W,y,J,te]}class Info extends SvelteComponent{constructor(e){super(),init(this,e,instance$8,create_fragment$8,safe_not_equal,{record:0,graph:11,users:1,schema:2})}}const{window:window_1}=globals;function get_each_context$2(o,e,n){const r=o.slice();return r[21]=e[n],r}function create_if_block_5(o){let e,n,r;return{c(){e=element("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
2024-08-22 17:59:06 +03:00
Save`,attr(e,"type","button"),attr(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",o[11]),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_if_block_4(o){let e,n,r;return{c(){e=element("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
2024-08-23 18:15:18 +03:00
Create`,attr(e,"class","button primary btn-spinner")},m(c,u){insert$1(c,e,u),n||(r=listen(e,"click",o[11]),n=!0)},p:noop,d(c){c&&detach(e),n=!1,r()}}}function create_if_block_3(o){let e,n;return e=new Info({props:{record:o[0],graph:o[1],users:o[4],schema:o[2]}}),{c(){create_component(e.$$.fragment)},m(r,c){mount_component(e,r,c),n=!0},p(r,c){const u={};c&1&&(u.record=r[0]),c&2&&(u.graph=r[1]),c&16&&(u.users=r[4]),c&4&&(u.schema=r[2]),e.$set(u)},i(r){n||(transition_in(e.$$.fragment,r),n=!0)},o(r){transition_out(e.$$.fragment,r),n=!1},d(r){destroy_component(e,r)}}}function create_if_block_2(o){let e,n;return e=new Graph({props:{graph:o[1],record:o[0]}}),{c(){create_component(e.$$.fragment)},m(r,c){mount_component(e,r,c),n=!0},p(r,c){const u={};c&2&&(u.graph=r[1]),c&1&&(u.record=r[0]),e.$set(u)},i(r){n||(transition_in(e.$$.fragment,r),n=!0)},o(r){transition_out(e.$$.fragment,r),n=!1},d(r){destroy_component(e,r)}}}function create_if_block$5(o){let e,n,r=[],c=new Map,u,h;e=new FilePreview({props:{record:o[0],schema:o[2]}});let p=ensure_array_like(o[9]);const b=y=>y[21].name;for(let y=0;y<p.length;y+=1){let k=get_each_context$2(o,p,y),A=b(k);c.set(A,r[y]=create_each_block$2(A,k))}return{c(){create_component(e.$$.fragment),n=space$3();for(let y=0;y<r.length;y+=1)r[y].c();u=empty$1()},m(y,k){mount_component(e,y,k),insert$1(y,n,k);for(let A=0;A<r.length;A+=1)r[A]&&r[A].m(y,k);insert$1(y,u,k),h=!0},p(y,k){const A={};k&1&&(A.record=y[0]),k&4&&(A.schema=y[2]),e.$set(A),k&623&&(p=ensure_array_like(y[9]),group_outros(),r=update_keyed_each(r,k,b,1,y,p,c,u.parentNode,outro_and_destroy_block,create_each_block$2,u,get_each_context$2),check_outros())},i(y){if(!h){transition_in(e.$$.fragment,y);for(let k=0;k<p.length;k+=1)transition_in(r[k]);h=!0}},o(y){transition_out(e.$$.fragment,y);for(let k=0;k<r.length;k+=1)transition_out(r[k]);h=!1},d(y){y&&(detach(n),detach(u)),destroy_component(e,y);for(let k=0;k<r.length;k+=1)r[k].d(y)}}}function create_if_block_1$3(o){let e,n,r,c;function u(b){o[15](b)}function h(b){o[16](b)}let p={field:o[21],schema:o[2],record:o[0],validationErrors:o[5],isCreateMode:o[3]};return o[0].data!==void 0&&(p.data=o[0].data),o[1]!==void 0&&(p.graph=o[1]),e=new FormField({props:p}),binding_callbacks.push(()=>bind(e,"data",u)),binding_callbacks.push(()=>bind(e,"graph",h)),{c(){create_component(e.$$.fragment)},m(b,y){mount_component(e,b,y),c=!0},p(b,y){const k={};y&4&&(k.schema=b[2]),y&1&&(k.record=b[0]),y&32&&(k.validationErrors=b[5]),y&8&&(k.isCreateMode=b[3]),!n&&y&1&&(n=!0,k.data=b[0].data,add_flush_callback(()=>n=!1)),!r&&y&2&&(r=!0,k.graph=b[1],add_flush_callback(()=>r=!1)),e.$set(k)},i(b){c||(transition_in(e.$$.fragment,b),c=!0)},o(b){transition_out(e.$$.fragment,b),c=!1},d(b){destroy_component(e,b)}}}function create_each_block$2(o,e){let n,r,c,u=e[6]===e[21].group&&create_if_block_1$3(e);return{key:o,first:null,c(){n=empty$1(),u&&u.c(),r=empty$1(),this.first=n},m(h,p){insert$1(h,n,p),u&&u.m(h,p),insert$1(h,r,p),c=!0},p(h,p){e=h,e[6]===e[21].group?u?(u.p(e,p),p&64&&transition_in(u,1)):(u=create_if_block_1$3(e),u.c(),transition_in(u,1),u.m(r.parentNode,r)):u&&(group_outros(),transition_out(u,1,1,()=>{u=null}),check_outros())},i(h){c||(transition_in(u),c=!0)},o(h){transition_out(u),c=!1},d(h){h&&(detach(n),detach(r)),u&&u.d(h)}}}function create_fragment$7(o){let e,n,r,c,u,h,p,b,y,k,A,R,N,F,V,W,J,te,j,ae,fe;function _e(Le){o[12](Le)}function ne(Le){o[13](Le)}let Se={schema:o[2],isCreateMode:o[3]};o[0]!==void 0&&(Se.record=o[0]),o[6]!==void 0&&(Se.activeContentTab=o[6]),r=new EditHeader({props:Se}),binding_callbacks.push(()=>bind(r,"record",_e)),binding_callbacks.push(()=>bind(r,"activeContentTab",ne));function De(Le,je){if(Le[3])return create_if_block_4;if(Le[8])return create_if_block_5}let Be=De(o),Te=Be&&Be(o);b=new Title({props:{schema:o[2],record:o[0],isCreateMode:o[3]}}),k=new ErrorAlert({props:{message:o[7]}});function Oe(Le){o[14](Le)}let yt={schema:o[2],isCreateMode:o[3]};o[6]!==void 0&&(yt.active=o[6]),N=new ContentTabs({props:yt}),binding_callbacks.push(()=>bind(N,"active",Oe));const Tt=[crea