Files
im/plugin/admin/public/libs/froala/js/plugins/filestack.min.js
T

7 lines
23 KiB
JavaScript
Raw Normal View History

2025-11-07 09:56:20 +08:00
/*!
* froala_editor v4.3.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2024 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(R){"use strict";function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function L(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function r(e,t){if(e){if("string"==typeof e)return c(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==i["return"]||i["return"]()}finally{if(l)throw s}}}}var U,D;R=R&&R.hasOwnProperty("default")?R["default"]:R,Object.assign(R.POPUP_TEMPLATES,{"filestackPlugin.error":"[_UPLOAD_LAYER_]"}),R.FILESTACK_PICKER_OPTIONS_MEDIA_MAX_SUPPORTED=[".pdf",".docx",".ppt",".pptx",".doc",".xlsx",".xls",".csv",".txt","image/jpeg","image/png","image/jpg","image/gif","image/webp","video/*","audio/*","mp3"],R.REQUIRED_PLUGINS=["image","video","file","filesManager"],R.FILESTACK_PICKER_OPTIONS_IMAGE_ONLY_SUPPORTED=["image/jpeg","image/png","image/jpg","image/gif","image/webp"],R.FILESTACK_DEFAULT_ACCEPT_FILE_TYPES=[".pdf",".docx",".ppt",".pptx",".doc",".xlsx",".xls",".csv",".txt"],R.FILESTACK_PICKER_OPTIONS_VIDEO_ONLY_SUPPORTED=["video/*"],R.FILESTACK_PICKER_OPTIONS_FROMSOURCES_MAX_SUPPORTED=["local_file_system","imagesearch","url","googledrive","facebook","instagram","dropbox"],R.FILESTACK_PICKER_DEFAULT_OPTIONS={displayMode:"overlay",uploadInBackground:!1,stage:{cname:"stage.filestackapi.com"}},Object.assign(R.DEFAULTS,{filestackOptions:{}}),R.FILE_STACK_URL_PART="filestack",R.PLUGINS.filestack=function(u){var o,f,t=["pdf","msword","vnd.openxmlformats-officedocument.wordprocessingml.document","vnd.ms-excel","vnd.openxmlformats-officedocument.spreadsheetml.sheet","vnd.ms-powerpoint","vnd.openxmlformats-officedocument.presentationml.presentation","csv","plain","ogg"],d=1,a=4,m=5,g=6,l=7,r={};function k(e,t,i){v(i?u.language.translate(r[e])+"\nResponse: "+JSON.stringify(i):u.language.translate(r[e]),t)}function v(e,t,i,n){var o;if((o=u.popups.get("filestackPlugin.error"))||(o=p(e)),i&&(o.find(".fr-image-progress-bar-layer").addClass("fr-active"),o.find(".fr-error-message").addClass("fr-layer"),o.find(".fr-buttons").hide()),!!u.$tb){var s;"openFilePicker"===t?s="openFilePicker":"openFilePickerReplaceImageOnly"===t||"openFilePickerImage"===t?s="insertImage":"openFilePickerReplaceVideoOnly"===t||"openFilePickerVideo"===t?s="insertVideo":"openFilePickerVideoOnly"===t?s="openFilePickerVideoOnly":"openFilePickerImageOnly"===t?s="openFilePickerImageOnly":"openFilePickerFile"===t&&(s="openFilePickerFile");var a=u.$tb.find(".fr-command[data-cmd='".concat(s,"']"));if(i)u.popups.show("filestackPlugin.error",n.x,n.y);else if(!o.hasClass("fr-active")&&(u.popups.refresh("filestackPlugin.error"),u.popups.setContainer("filestackPlugin.error",u.$tb),a.isVisible()||u.opts.toolbarInline)){var l=u.opts.toolbarInline&&["openFilePickerImage","openFilePickerVideo"].includes(t)?u.$(".fr-popup")[0].style:u.button.getPosition(a),r=l.left,c=l.top;u.popups.show("filestackPlugin.error",r,c,a.outerHeight())}}}function P(){var e="",t=function i(){var t=[];return R.REQUIRED_PLUGINS.forEach(function(e){u.opts.pluginsEnabled.indexOf(e)<0&&t.push(e.charAt(0).toUpperCase()+e.slice(1))}),t}();return e=t.join(", "),1<t.length?e+=" plugin are":e+=" plugin is",e}function p(e){var t=e.includes("Do you want to enable"),i=t?"<div