!function(e){if(void0===e)throwError("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeofCKEDITOR)throwError("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal=void0===CKEDITOR.config.jqueryOverrideVal||CKEDITOR.config.jqueryOverrideVal,e.extend(e.fn,{ckeditorGet:function(){vare=this.eq(0).data("ckeditorInstance");if(!e)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";returne},ckeditor:function(t,r){if(!CKEDITOR.env.isCompatible)throwError("The environment is incompatible.");if(!e.isFunction(t)){varn=r;r=t,t=n}vari=[];r=r||{},this.each((function(){varn=e(this),o=n.data("ckeditorInstance"),a=n.data("_ckeditorInstanceLock"),d=this,c=newe.Deferred;i.push(c.promise()),o&&!a?(t&&t.apply(o,[this]),c.resolve()):a?o.once("instanceReady",(function(){setTimeout((functione(){o.element?(o.element.$==d&&t&&t.apply(o,[d]),c.resolve()):setTimeout(e,100)}),0)}),null,null,9999):((r.autoUpdateElement||void0===r.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)&&(r.autoUpdateElementJquery=!0),r.autoUpdateElement=!1,n.data("_ckeditorInstanceLock",!0),o=e(this).is("textarea")?CKEDITOR.replace(d,r):CKEDITOR.inline(d,r),n.data("ckeditorInstance",o),o.on("instanceReady",(function(r){vari=r.editor;setTimeout((functiono(){if(i.element){if(r.removeListener(),i.on("dataReady",(function(){n.trigger("dataReady.ckeditor",[i])})),i.on("setData",(function(e){n.trigger("setData.ckeditor",[i,e.data])})),i.on("getData",(function(e){n.trigger("getData.ckeditor",[i,e.data])}),999),i.on("destroy",(function(){n.trigger("destroy.ckeditor",[i])})),i.on("save",(function(){returne(d.form).submit(),!1}),null,null,20),i.config.autoUpdateElementJquery&&n.is("textarea")&&e(d.form).length){vara=function(){n.ckeditor((function(){i.updateElement()}))};e(d.form).submit(a),e(d.form).bind("form-pre-serialize",a),n.bind("destroy.ckeditor",(function(){e(d.form).unbind("submit",a),e(d.form).unbind("form-pre-serialize",a)}))}i.on("destroy",(function(){n.removeData("ckeditorInstance")})),n.removeData("_ckeditorInstanceLock"),n.trigger("instanceReady.ckeditor",[i]),t&&t.apply(i,[d]),c.resolve()}elsesetTimeout(o,100)}),0)}),null,null,9999))}));varo=newe.Deferred;returnthis.promise=o.promise(),e.when.apply(this,i).then((function(){o.resolve()})),this.editor=this.eq(0).data("ckeditorInstance"),this}}),CKEDITOR.config.jqueryOverrideVal&&(e.fn.val=CKEDITOR.tools.override(e.fn.val,(function(t){returnfunction(r){if(arguments.length){varn=this,i=[],o=this.each((function(){varn=e(this),o=n.data("ckeditorInstance");if(n.is("textarea")&&o){vara=newe.Deferred;returno.setData(r,(function(){a.resolve()})),i.push(a.promise()),!0}returnt.call(n,r)}));if(i.length){vara=newe.Deferred;returne.when.apply(this,i).done((function(){a.resolveWith(n)})),a.promise()}returno}vard=(o=e(this).eq(0)).data("ckeditorInstance");returno.is("textarea")&&d?d.getData():t.call(o)}})))}(window.jQuery);