1import{Accessibility as x,Command as C,CommandCollection as M,Context as R,ContextPlugin as L,EditingKeystrokeHandler as U,Editor as v,ElementApiMixin as F,MultiCommand as S,PendingActions as h,Plugin as d,_DEFAULT_ACCESSIBILITY_GROUP_ID as W,_getEditorUsageData as D,attachToForm as I,secureSourceElement as k}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{CKEditorError as p,Collection as b,Config as K,DOCUMENTATION_URL as H,DomEmitterMixin as N,ElementReplacer as V,EmitterMixin as B,EventInfo as $,FocusTracker as z,KeystrokeHandler as j,Locale as G,ObservableMixin as c,Rect as X,ResizeObserver as Y,_clearTranslations as J,_getEmitterId as Q,_getEmitterListenedTo as Z,_getUserAgent as ee,_isAndroid as te,_isBlink as re,_isGecko as se,_isMac as ie,_isMediaForcedColors as oe,_isMotionReduced as ae,_isRegExpUnicodePropertySupported as ne,_isSafari as de,_isWindows as le,_isiOS as ue,_setEmitterId as he,_translate as pe,_unifyTranslations as ce,abortableDebounce as ge,add as fe,areConnectedThroughProperties as _e,collectStylesheets as me,compareArrays as we,count as be,crc32 as Ae,createElement as Ee,delay as Pe,diff as ye,diffToChanges as Te,env as xe,exponentialDelay as Ce,fastDiff as Me,findClosestScrollableAncestor as Re,first as Le,formatHtml as Ue,getAncestors as ve,getBorderWidths as Fe,getCode as Se,getCommonAncestor as We,getDataFromElement as De,getEnvKeystrokeText as Ie,getLanguageDirection as ke,getLocalizedArrowKeyCodeDirection as qe,getOptimalPosition as Oe,getPositionedAncestor as Ke,getRangeFromMouseEvent as He,getVisualViewportOffset as Ne,global as Ve,indexOf as Be,insertAt as $e,insertToPriorityArray as ze,isArrowKeyCode as je,isCombiningMark as Ge,isComment as Xe,isForwardArrowKeyCode as Ye,isHighSurrogateHalf as Je,isInsideCombinedSymbol as Qe,isInsideEmojiSequence as Ze,isInsideSurrogatePair as et,isIterable as tt,isLowSurrogateHalf as rt,isNode as st,isRange as it,isText as ot,isValidAttributeName as at,isViewWithFocusTracker as nt,isVisible as dt,isWindow as lt,keyCodes as ut,logError as ht,logWarning as g,mapsEqual as pt,nth as ct,objectToMap as gt,parseBase64EncodedObject as ft,parseKeystroke as _t,priorities as mt,releaseDate as wt,remove as bt,retry as At,scrollAncestorsToShowTarget as Et,scrollViewportToShowTarget as Pt,setDataInElement as yt,spliceArray as Tt,spy as xt,toArray as Ct,toMap as Mt,toUnit as Rt,uid as A,version as Lt,wait as Ut}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";var l=class extends c(){total;_reader;_data;constructor(){super();let e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){let t=this._reader;return this.total=e.size,new Promise((s,r)=>{t.onload=()=>{let o=t.result;this._data=o,s(o)},t.onerror=()=>{r("error")},t.onabort=()=>{r("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}},a=class extends d{loaders=new b;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return g("filerepository-no-upload-adapter"),null;let t=new u(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(s=>{this._loadersMap.set(s,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let s=0;for(let r of this.loaders)s+=r.uploaded;this.uploaded=s}),t.on("change:uploadTotal",()=>{let s=0;for(let r of this.loaders)r.uploadTotal&&(s+=r.uploadTotal);this.uploadTotal=s}),t}destroyLoader(e){let t=e instanceof u?e:this.getLoader(e);
1t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((s,r)=>{s===t&&this._loadersMap.delete(r)})}_updatePendingAction(){let e=this.editor.plugins.get(h);if(this.loaders.length){if(!this._pendingAction){let t=this.editor.t,s=r=>`${t("Upload in progress")} ${parseInt(r)}%.`;this._pendingAction=e.add(s(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",s)}}else e.remove(this._pendingAction),this._pendingAction=null}},u=class extends c(){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=A(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new l,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(s,r)=>r?s/r*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new p("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new p("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){let e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){let t={};return t.promise=new Promise((s,r)=>{t.rejecter=r,t.isFulfilled=!1,e.then(o=>{t.isFulfilled=!0,s(o)}).catch(o=>{t.isFulfilled=!0,r(o)})}),t}},f=class extends d{static get requires(){return[a]}static get pluginName(){return"Base64UploadAdapter"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(a).createUploadAdapter=e=>new P(e)}},P=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{let s=this.reader=new window.FileReader;s.addEventListener("load",()=>{e({default:s.result})}),s.addEventListener("error",r=>{t(r)}),s.addEventListener("abort",()=>{t()}),this.loader.file.then(r=>{s.readAsDataURL(r)})})}abort(){this.reader.abort()}},_=class extends d{static get requires(){return[a]}static get pluginName(){return"SimpleUploadAdapter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.config.get("simpleUpload");if(e){if(!e.uploadUrl){g("simple-upload-adapter-missing-uploadurl");return}this.editor.plugins.get(a).createUploadAdapter=t=>new m(t,e)}}},m=class{loader;options;xhr;constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,s)=>{this._initRequest(),this._initListeners(t,s,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){let e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,s){let r=this.xhr,o=this.loader,w=`Couldn't upload file: ${s.name}.`;r.addEventListener("error",()=>t(w)),r.addEventListener("abort",()=>t()),r.addEventListener("load",()=>{let i=r.response;if(!i||i.error)return t(i&&i.error&&i.error.message?i.error.message:w);let E=i.url?{default:i.url}:i.urls;e({...i,urls:E})});r.upload&&r.upload.addEventListener("progress",i=>{i.lengthComputable&&(o.uploadTotal=i.total,o.uploaded=i.loaded)})}_sendRequest(e){let t=this.options.headers||{};typeof t=="function"&&(t=t(e));let s=this.options.withCredentials||!1;for(let o of Object.keys(t))this.xhr.setRequestHeader(o,t[o]);this.xhr.withCredentials=s;let r=new FormData;r.append("upload",e),this.xhr.send(r)}};export{f as Base64UploadAdapter,l as FileReader,a as FileRepository,_ as SimpleUploadAdapter}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-upload/dist/index.js: 5 (** 6 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 7 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 8 *) 9 (* istanbul ignore else -- @preserve *) 10*/ 11//# sourceMappingURL=@ckeditor$ckeditor5-upload$dist$index.js.(WI6LA7O6).js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.