1import{Accessibility as v,Command as S,CommandCollection as L,Context as M,ContextPlugin as h,EditingKeystrokeHandler as P,Editor as D,ElementApiMixin as I,MultiCommand as F,PendingActions as O,Plugin as H,_DEFAULT_ACCESSIBILITY_GROUP_ID as N,_getEditorUsageData as U,attachToForm as K,secureSourceElement as V}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{CKEditorError as n,Collection as W,Config as X,DOCUMENTATION_URL as G,DomEmitterMixin as z,ElementReplacer as J,EmitterMixin as _,EventInfo as j,FocusTracker as Y,KeystrokeHandler as $,Locale as Q,ObservableMixin as T,Rect as Z,ResizeObserver as ee,_clearTranslations as te,_getEmitterId as re,_getEmitterListenedTo as se,_getUserAgent as oe,_isAndroid as ie,_isBlink as ne,_isGecko as ae,_isMac as ue,_isMediaForcedColors as le,_isMotionReduced as ce,_isRegExpUnicodePropertySupported as he,_isSafari as de,_isWindows as fe,_isiOS as ge,_setEmitterId as me,_translate as pe,_unifyTranslations as _e,abortableDebounce as Te,add as Ee,areConnectedThroughProperties as ke,collectStylesheets as we,compareArrays as ye,count as Re,crc32 as be,createElement as Ce,delay as xe,diff as Ae,diffToChanges as ve,env as Se,exponentialDelay as Le,fastDiff as Me,findClosestScrollableAncestor as Pe,first as De,formatHtml as Ie,getAncestors as Fe,getBorderWidths as Oe,getCode as He,getCommonAncestor as Ne,getDataFromElement as Ue,getEnvKeystrokeText as Ke,getLanguageDirection as Ve,getLocalizedArrowKeyCodeDirection as qe,getOptimalPosition as Be,getPositionedAncestor as We,getRangeFromMouseEvent as Xe,getVisualViewportOffset as Ge,global as ze,indexOf as Je,insertAt as je,insertToPriorityArray as Ye,isArrowKeyCode as $e,isCombiningMark as Qe,isComment as Ze,isForwardArrowKeyCode as et,isHighSurrogateHalf as tt,isInsideCombinedSymbol as rt,isInsideEmojiSequence as st,isInsideSurrogatePair as ot,isIterable as it,isLowSurrogateHalf as nt,isNode as at,isRange as ut,isText as lt,isValidAttributeName as ct,isViewWithFocusTracker as ht,isVisible as dt,isWindow as ft,keyCodes as gt,logError as mt,logWarning as E,mapsEqual as pt,nth as _t,objectToMap as Tt,parseBase64EncodedObject as Et,parseKeystroke as kt,priorities as wt,releaseDate as yt,remove as Rt,retry as bt,scrollAncestorsToShowTarget as Ct,scrollViewportToShowTarget as xt,setDataInElement as At,spliceArray as vt,spy as St,toArray as Lt,toMap as Mt,toUnit as Pt,uid as Dt,version as It,wait as Ft}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";var w={autoRefresh:!0},k=36e5,y=5e3,l=class o extends T(){_refresh;_options;_tokenRefreshTimeout;_isDestroyed=!1;constructor(e,t={}){if(super(),!e)throw new n("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),typeof e=="function"?this._refresh=e:this._refresh=()=>R(e),this._options={...w,...t}}init(){return new Promise((e,t)=>{if(!this.value){this.refreshToken().then(e).catch(t);return}this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)})}refreshToken(){let e=this._options.autoRefresh;return this._refresh().then(t=>(this._validateTokenValue(t),this.set("value",t),e&&this._registerRefreshTokenTimeout(),this)).catch(t=>{throw E("token-refresh-failed",{autoRefresh:e}),e&&this._registerRefreshTokenTimeout(y),t})}destroy(){this._isDestroyed=!0,clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){let t=typeof e=="string",r=!/^".*"$/.test(e),s=t&&e.split(".").length===3;if(!(r&&s))throw new n("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(e){if(clearTimeout(this._tokenRefreshTimeout),this._isDestroyed)return;let t=e||this._getTokenRefreshTimeoutTime();this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},t)}_getTokenRefreshTimeoutTime(){try{let[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?(t>2147483647&&console.warn("Token expiration time exceeds 32-bit integer range. This might cause unpredictable token refresh timing. Token expiration time should always be provided in seconds.",{tokenExpireTime:t}),Math.floor((t*1e3-Date.now())/2)):k}catch{return k}}static create(e,t={}){return new o(e,t).init()}};function R(o){return new Promise((e,t)=>
1{let r=new XMLHttpRequest;r.open("GET",o),r.addEventListener("load",()=>{let s=r.status,i=r.response;return s<200||s>299?t(new n("token-cannot-download-new-token",null)):e(i)}),r.addEventListener("error",()=>t(new Error("Network Error"))),r.addEventListener("abort",()=>t(new Error("Abort"))),r.send()})}var d=/^data:(\S*?);base64,/,f=class extends _(){file;xhr;_token;_apiAddress;constructor(e,t,r){if(super(),!e)throw new n("fileuploader-missing-file",null);if(!t)throw new n("fileuploader-missing-token",null);if(!r)throw new n("fileuploader-missing-api-address",null);this.file=C(e)?b(e):e,this._token=t,this._apiAddress=r}onProgress(e){return this.on("progress",(t,r)=>e(r)),this}onError(e){return this.once("error",(t,r)=>e(r)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){let e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){let e=this.xhr,t=r=>()=>this.fire("error",r);e.addEventListener("error",t("Network Error")),e.addEventListener("abort",t("Abort"));e.upload&&e.upload.addEventListener("progress",r=>{r.lengthComputable&&this.fire("progress",{total:r.total,uploaded:r.loaded})}),e.addEventListener("load",()=>{let r=e.status,s=e.response;if(r<200||r>299)return this.fire("error",s.message||s.error)})}_sendRequest(){let e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((r,s)=>{t.addEventListener("load",()=>{let i=t.status,a=t.response;return i<200||i>299?a.message?s(new n("fileuploader-uploading-data-failed",this,{message:a.message})):s(a.error):r(a)}),t.addEventListener("error",()=>s(new Error("Network Error"))),t.addEventListener("abort",()=>s(new Error("Abort"))),t.send(e)})}};function b(o,e=512){try{let t=o.match(d)[1],r=atob(o.replace(d,"")),s=[];for(let i=0;i<r.length;i+=e){let a=r.slice(i,i+e),p=new Array(a.length);for(let u=0;u<a.length;u++)p[u]=a.charCodeAt(u);s.push(new Uint8Array(p))}return new Blob(s,{type:t})}catch{throw new n("fileuploader-decoding-image-data-error",null)}}function C(o){return typeof o!="string"?!1:!!o.match(d)?.length}var g=class{_token;_apiAddress;constructor(e,t){if(!e)throw new n("uploadgateway-missing-token",null);if(!t)throw new n("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new f(e,this._token,this._apiAddress)}},c=class extends h{static get pluginName(){return"CloudServicesCore"}static get isOfficialPlugin(){return!0}createToken(e,t){return new l(e,t)}createUploadGateway(e,t){return new g(e,t)}},m=class extends h{tokenUrl;uploadUrl;webSocketUrl;bundleVersion;autoRefresh=!0;token=null;_tokens=new Map;static get pluginName(){return"CloudServices"}static get isOfficialPlugin(){return!0}static get requires(){return[c]}
vendor: 1,237 bytes, lines 1-11
1async init(){let t=this.context.config.get("cloudServices")||{};for(let[i,a]of Object.entries(t))this[i]=a;if(!this.tokenUrl){this.token=null;return}let s=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl,{autoRefresh:this.autoRefresh});try{this.token=await s.init(),this._tokens.set(this.tokenUrl,this.token)}catch(i){throw s.destroy(),i}}async registerTokenUrl(e){if(this._tokens.has(e))return this.getTokenFor(e);let r=await this.context.plugins.get("CloudServicesCore").createToken(e,{autoRefresh:this.autoRefresh}).init();return this._tokens.set(e,r),r}getTokenFor(e){let t=this._tokens.get(e);if(!t)throw new n("cloudservices-token-not-registered",this);return t}destroy(){super.destroy();for(let e of this._tokens.values())e.destroy()}};export{m as CloudServices,c as CloudServicesCore,l as Token}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-cloud-services/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-cloud-services$dist$index.js.(OUHJ3NHN).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.