Sindbad~EG File Manager

Current Path : /var/www/html/ceade.tocsa.com.py/lib/amd/build/emoji/
Upload File :
Current File : /var/www/html/ceade.tocsa.com.py/lib/amd/build/emoji/auto_complete.min.js

function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("core/emoji/auto_complete",["exports","core/emoji/data","core/templates","core/utils","core/localstorage","core/key_codes"],(function(_exports,EmojiData,_templates,_utils,_localstorage,_key_codes){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,EmojiData=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(EmojiData),_localstorage=_interopRequireDefault(_localstorage),_key_codes=_interopRequireDefault(_key_codes);var fn,_ref,SELECTORS_EMOJI_BUTTON='[data-region="emoji-button"]',SELECTORS_ACTIVE_EMOJI_BUTTON='[data-region="emoji-button"].active',getRecentEmojis=function(){var storedData=_localstorage.default.get("moodle-recent-emojis");return storedData?JSON.parse(storedData):[]},addRecentEmoji=function(unified,shortName){var newEmoji={unified:unified,shortnames:[shortName]},recentEmojis=getRecentEmojis(),newRecentEmojis=[newEmoji].concat(_toConsumableArray(recentEmojis.filter((function(emoji){return emoji.unified!=newEmoji.unified}))));newRecentEmojis=newRecentEmojis.slice(0,27),_localstorage.default.set("moodle-recent-emojis",JSON.stringify(newRecentEmojis))},getEmojiTextFromShortName=function(shortName){var unified=EmojiData.byShortName[shortName];if(unified){var charCodes=unified.split("-").map((function(code){return"0x".concat(code)}));return String.fromCodePoint.apply(null,charCodes)}return null},render=(fn=regeneratorRuntime.mark((function _callee(root,shortNames){var renderContext,html;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:return renderContext={emojis:shortNames.map((function(shortName,index){return{active:0===index,emojitext:getEmojiTextFromShortName(shortName),displayshortname:":".concat(shortName,":"),shortname:shortName,unified:EmojiData.byShortName[shortName]}}))},_context.next=3,(0,_templates.render)("core/emoji/auto_complete",renderContext);case 3:html=_context.sent,root.innerHTML=html;case 5:case"end":return _context.stop()}}),_callee)})),_ref=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},function(_x,_x2){return _ref.apply(this,arguments)}),getShortNameFromText=function(text){return text.replace(/:/g,"")},getActiveEmojiSuggestion=function(root){return root.querySelector(SELECTORS_ACTIVE_EMOJI_BUTTON)},selectEmojiElement=function(element,selectCallback){var shortName=element.getAttribute("data-short-name"),unified=element.getAttribute("data-unified");addRecentEmoji(unified,shortName),selectCallback(element.innerHTML.trim())};return _exports.default=function(root,textArea,hasSuggestionCallback,selectCallback){var hasSuggestions=!1,previousSearchText="";textArea.addEventListener("keyup",(0,_utils.debounce)((function(){var searchText=function(text,position){var startMatches=text.slice(0,position).match(/(\S*)$/),endMatches=text.slice(position).match(/^(\S*)/),startText="",endText="";return startMatches&&(startText=startMatches[startMatches.length-1]),endMatches&&(endText=endMatches[endMatches.length-1]),"".concat(startText).concat(endText)}(textArea.value,textArea.selectionStart);if(searchText!==previousSearchText){if(previousSearchText=searchText,function(text){return/^:[^:\s]+:$/.test(text)}(searchText)){var shortName=getShortNameFromText(searchText),emojiText=getEmojiTextFromShortName(shortName);hasSuggestions=!1,emojiText&&(addRecentEmoji(EmojiData.byShortName[shortName],shortName),selectCallback(emojiText))}else if(function(text){return/^:[^:\s]*$/.test(text)}(searchText)){var suggestions=(searchTerm=getShortNameFromText(searchText),limit=50,""===searchTerm?getRecentEmojis().map((function(data){return data.shortnames[0]})).slice(0,limit):(searchTerm=searchTerm.toLowerCase(),Object.keys(EmojiData.byShortName).filter((function(shortName){return shortName.includes(searchTerm)})).slice(0,limit)));suggestions.length?(render(root,suggestions),hasSuggestions=!0):hasSuggestions=!1}else hasSuggestions=!1;var searchTerm,limit;hasSuggestionCallback(hasSuggestions)}}),200)),textArea.addEventListener("keydown",(function(e){if(hasSuggestions&&!(e.shiftKey||e.metaKey||e.altKey||e.ctrlKey))switch(e.which){case _key_codes.default.escape:hasSuggestions=!1,hasSuggestionCallback(!1);break;case _key_codes.default.arrowLeft:!function(root){var activeEmojiSuggestion=getActiveEmojiSuggestion(root),previousSuggestion=activeEmojiSuggestion.previousElementSibling;previousSuggestion&&(activeEmojiSuggestion.classList.remove("active"),previousSuggestion.classList.add("active"),previousSuggestion.scrollIntoView({behaviour:"smooth",inline:"center"}))}(root),e.preventDefault();break;case _key_codes.default.arrowRight:!function(root){var activeEmojiSuggestion=getActiveEmojiSuggestion(root),nextSuggestion=activeEmojiSuggestion.nextElementSibling;nextSuggestion&&(activeEmojiSuggestion.classList.remove("active"),nextSuggestion.classList.add("active"),nextSuggestion.scrollIntoView({behaviour:"smooth",inline:"center"}))}(root),e.preventDefault();break;case _key_codes.default.enter:selectEmojiElement(getActiveEmojiSuggestion(root),selectCallback),e.preventDefault(),e.stopPropagation()}})),root.addEventListener("click",(function(e){var target=e.target;target.matches(SELECTORS_EMOJI_BUTTON)&&selectEmojiElement(target,selectCallback)}))},_exports.default}));

//# sourceMappingURL=auto_complete.min.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists