/*! elementor - v3.16.0 - 14-09-2023 */ "use strict"; (self["webpackChunkelementor"] = self["webpackChunkelementor"] || []).push([["accordion"],{ /***/ "../assets/dev/js/frontend/handlers/accordion.js": /*!*******************************************************!*\ !*** ../assets/dev/js/frontend/handlers/accordion.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _baseTabs = _interopRequireDefault(__webpack_require__(/*! ./base-tabs */ "../assets/dev/js/frontend/handlers/base-tabs.js")); class Accordion extends _baseTabs.default { getDefaultSettings() { const defaultSettings = super.getDefaultSettings(); return { ...defaultSettings, showTabFn: 'slideDown', hideTabFn: 'slideUp' }; } } exports["default"] = Accordion; /***/ }), /***/ "../assets/dev/js/frontend/handlers/base-tabs.js": /*!*******************************************************!*\ !*** ../assets/dev/js/frontend/handlers/base-tabs.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class baseTabs extends elementorModules.frontend.handlers.Base { getDefaultSettings() { return { selectors: { tablist: '[role="tablist"]', tabTitle: '.elementor-tab-title', tabContent: '.elementor-tab-content' }, classes: { active: 'elementor-active' }, showTabFn: 'show', hideTabFn: 'hide', toggleSelf: true, hidePrevious: true, autoExpand: true, keyDirection: { ArrowLeft: elementorFrontendConfig.is_rtl ? 1 : -1, ArrowUp: -1, ArrowRight: elementorFrontendConfig.is_rtl ? -1 : 1, ArrowDown: 1 } }; } getDefaultElements() { const selectors = this.getSettings('selectors'); return { $tabTitles: this.findElement(selectors.tabTitle), $tabContents: this.findElement(selectors.tabContent) }; } activateDefaultTab() { const settings = this.getSettings(); if (!settings.autoExpand || 'editor' === settings.autoExpand && !this.isEdit) { return; } const defaultActiveTab = this.getEditSettings('activeItemIndex') || 1, originalToggleMethods = { showTabFn: settings.showTabFn, hideTabFn: settings.hideTabFn }; // Toggle tabs without animation to avoid jumping this.setSettings({ showTabFn: 'show', hideTabFn: 'hide' }); this.changeActiveTab(defaultActiveTab); // Return back original toggle effects this.setSettings(originalToggleMethods); } handleKeyboardNavigation(event) { const tab = event.currentTarget, $tabList = jQuery(tab.closest(this.getSettings('selectors').tablist)), // eslint-disable-next-line @wordpress/no-unused-vars-before-return $tabs = $tabList.find(this.getSettings('selectors').tabTitle), isVertical = 'vertical' === $tabList.attr('aria-orientation'); switch (event.key) { case 'ArrowLeft': case 'ArrowRight': if (isVertical) { return; } break; case 'ArrowUp': case 'ArrowDown': if (!isVertical) { return; } event.preventDefault(); break; case 'Home': event.preventDefault(); $tabs.first().trigger('focus'); return; case 'End': event.preventDefault(); $tabs.last().trigger('focus'); return; default: return; } const tabIndex = tab.getAttribute('data-tab') - 1, direction = this.getSettings('keyDirection')[event.key], nextTab = $tabs[tabIndex + direction]; if (nextTab) { nextTab.focus(); } else if (-1 === tabIndex + direction) { $tabs.last().trigger('focus'); } else { $tabs.first().trigger('focus'); } } deactivateActiveTab(tabIndex) { const settings = this.getSettings(), activeClass = settings.classes.active, activeFilter = tabIndex ? '[data-tab="' + tabIndex + '"]' : '.' + activeClass, $activeTitle = this.elements.$tabTitles.filter(activeFilter), $activeContent = this.elements.$tabContents.filter(activeFilter); $activeTitle.add($activeContent).removeClass(activeClass); $activeTitle.attr({ tabindex: '-1', 'aria-selected': 'false', 'aria-expanded': 'false' }); $activeContent[settings.hideTabFn](); $activeContent.attr('hidden', 'hidden'); } activateTab(tabIndex) { const settings = this.getSettings(), activeClass = settings.classes.active, $requestedTitle = this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]'), $requestedContent = this.elements.$tabContents.filter('[data-tab="' + tabIndex + '"]'), animationDuration = 'show' === settings.showTabFn ? 0 : 400; $requestedTitle.add($requestedContent).addClass(activeClass); $requestedTitle.attr({ tabindex: '0', 'aria-selected': 'true', 'aria-expanded': 'true' }); $requestedContent[settings.showTabFn](animationDuration, () => elementorFrontend.elements.$window.trigger('elementor-pro/motion-fx/recalc')); $requestedContent.removeAttr('hidden'); } isActiveTab(tabIndex) { return this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]').hasClass(this.getSettings('classes.active')); } bindEvents() { this.elements.$tabTitles.on({ keydown: event => { // Support for old markup that includes an `` tag in the tab if (jQuery(event.target).is('a') && `Enter` === event.key) { event.preventDefault(); } // We listen to keydowon event for these keys in order to prevent undesired page scrolling if (['End', 'Home', 'ArrowUp', 'ArrowDown'].includes(event.key)) { this.handleKeyboardNavigation(event); } }, keyup: event => { switch (event.code) { case 'ArrowLeft': case 'ArrowRight': this.handleKeyboardNavigation(event); break; case 'Enter': case 'Space': event.preventDefault(); this.changeActiveTab(event.currentTarget.getAttribute('data-tab')); break; } }, click: event => { event.preventDefault(); this.changeActiveTab(event.currentTarget.getAttribute('data-tab')); } }); } onInit() { super.onInit(...arguments); this.activateDefaultTab(); } onEditSettingsChange(propertyName) { if ('activeItemIndex' === propertyName) { this.activateDefaultTab(); } } changeActiveTab(tabIndex) { const isActiveTab = this.isActiveTab(tabIndex), settings = this.getSettings(); if ((settings.toggleSelf || !isActiveTab) && settings.hidePrevious) { this.deactivateActiveTab(); } if (!settings.hidePrevious && isActiveTab) { this.deactivateActiveTab(tabIndex); } if (!isActiveTab) { this.activateTab(tabIndex); } } } exports["default"] = baseTabs; /***/ }) }]); //# sourceMappingURL=accordion.c16b88b2e8a0c50189bc.bundle.js.map(function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window){"id":1916,"date":"2021-08-31T20:56:12","date_gmt":"2021-08-31T13:56:12","guid":{"rendered":"https:\/\/uetacad.com\/?p=1916"},"modified":"2021-08-31T20:56:15","modified_gmt":"2021-08-31T13:56:15","slug":"ao-hoa-su-dung-container-nhung-dieu-co-ban-can-biet","status":"publish","type":"post","link":"https:\/\/uetacad.com\/ao-hoa-su-dung-container-nhung-dieu-co-ban-can-biet\/","title":{"rendered":"\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng Container, nh\u1eefng \u0111i\u1ec1u c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft"},"content":{"rendered":"\n

1. Gi\u1edbi thi\u1ec7u<\/h3>\n\n\n\n

Nh\u01b0 c\u00e1c b\u1ea1n \u0111\u00e3 bi\u1ebft, trong nh\u1eefng n\u0103m g\u1ea7n \u0111\u00e2y kh\u00e1i ni\u1ec7m “\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng container”<\/strong> \u0111\u01b0\u1ee3c nh\u1eafc \u0111\u1ebfn kh\u00e1 nhi\u1ec1u. V\u1eady n\u00f3 l\u00e0 c\u00e1i g\u00ec, c\u00f3 nh\u1eefng \u01b0u \u0111i\u1ec3m g\u00ec v\u00e0 s\u1eed d\u1ee5ng n\u00f3 nh\u01b0 th\u1ebf n\u00e0o. B\u00e0i vi\u1ebft n\u00e0y c\u1ee7a m\u00ecnh xin \u0111\u01b0\u1ee3c n\u00eau nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n v\u1ec1 “\u1ea3o ho\u00e1 s\u1eed d\u1ee5ng Container” v\u00e0 so s\u00e1nh v\u1edbi “\u1ea2o ho\u00e1 truy\u1ec1n th\u1ed1ng” \u0111\u1ec3 ch\u00fang ta c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng h\u00ecnh dung. (lay2)<\/p>\n\n\n\n

2. \u1ea2o ho\u00e1 truy\u1ec1n th\u1ed1ng? (Hypervisor Virtualization)<\/h3>\n\n\n\n

N\u00f3i \u0111\u1ebfn \u1ea3o ho\u00e1 truy\u1ec1n th\u1ed1ng, ch\u00fang ta c\u00f3 th\u1ec3 h\u00ecnh dung \u0111\u01b0\u1ee3c ngay \u0111\u00f3 ch\u00ednh l\u00e0 c\u00e1ch s\u1eed d\u1ee5ng \u1ea3o ho\u00e1 th\u00f4ng th\u01b0\u1eddng m\u00e0 ng\u01b0\u1eddi d\u00f9ng hay l\u1ef1a ch\u1ecdn nh\u01b0: VMWare, Virtual Box, Parallel…<\/p>\n\n\n\n

\u0110\u00e2y ch\u00ednh l\u00e0 gi\u1ea3i ph\u00e1p r\u1ea5t t\u1ed1t khi ch\u00fang ta mu\u1ed1n ch\u1ea1y nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh c\u00f9ng m\u1ed9t l\u00fac tr\u00ean m\u1ed9t m\u00e1y. V\u1edbi gi\u1ea3i ph\u00e1p \u1ea3o ho\u00e1 truy\u1ec1n th\u1ed1ng. To\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng: t\u1eeb Ph\u1ea7n c\u1ee9ng (RAM, CPU, HDD…) cho \u0111\u1ebfn H\u1ec7 \u0111i\u1ec1u h\u00e0nh \u0111\u1ec1u \u0111\u01b0\u1ee3c “\u1ea3o ho\u00e1”. \u0110em l\u1ea1i tr\u1ea3i nghi\u1ec7m s\u1eed d\u1ee5ng g\u1ea7n t\u01b0\u01a1ng \u0111\u01b0\u01a1ng nh\u01b0 m\u1ed9t m\u00e1y th\u1eadt (hehe)<\/p>\n\n\n\n

M\u1ed9t \u0111\u1eb7c \u0111i\u1ec3m r\u1ea5t \u01b0u th\u1ebf n\u1eefa c\u1ee7a gi\u1ea3i ph\u00e1p n\u00e0y \u0111\u00f3 l\u00e0, ch\u00fang ta kh\u00f4ng c\u1ea7n quan t\u00e2m nhi\u1ec1u \u0111\u1ebfn h\u1ec7 \u0111i\u1ec1u h\u00e0nh c\u1ee7a m\u00e1y ch\u00ednh (host system: m\u00e1y \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 c\u00e0i m\u00e1y \u1ea3o) l\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o. Ch\u1ec9 c\u1ea7n c\u00f3 nhu c\u1ea7u c\u00e0i h\u1ec7 \u0111i\u1ec1u h\u00e0nh b\u1ea5t k\u1ef3 m\u00e0 “M\u00e1y \u1ea2o” h\u1ed7 tr\u1ee3 l\u00e0 \u0111\u1ec1u c\u00f3 th\u1ec3 c\u00e0i \u0111\u01b0\u1ee3c. VD tr\u00ean Ubuntu nh\u01b0ng ch\u00fang ta v\u1eabn c\u00f3 th\u1ec3 c\u00e0i \u0111\u01b0\u1ee3c m\u00e1y \u1ea3o window XP, window 7, Fedora, k\u1ec3 c\u1ea3 l\u00e0 MacOS … :what?:<\/p>\n\n\n\n

Tuy nhi\u00ean, m\u1eb7c d\u00f9 c\u00f3 kh\u00e1 nhi\u1ec1u \u01b0u \u0111i\u1ec3m nh\u01b0ng “m\u00e1y \u1ea3o” l\u1ea1i t\u1ed3n t\u1ea1i m\u1ed9t nh\u01b0\u1ee3c \u0111i\u1ec3m r\u1ea5t l\u1edbn: Vi\u1ec7c ph\u1ea3i \u1ea3o ho\u00e1 t\u1eeb ph\u1ea7n c\u1ee9ng \u0111\u1ebfn nguy\u00ean c\u1ea3 m\u1ed9t h\u1ec7 \u0111i\u1ec1u h\u00e0nh l\u00e0m ti\u00eau t\u1ed1n m\u1ed9t kho\u1ea3n t\u00e0i nguy\u00ean kh\u00f4ng h\u1ec1 nh\u1ecf c\u1ee7a h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7<\/strong> (host system). C\u00f3 th\u1ec3 l\u1ea5y v\u00ed d\u1ee5 d\u1ec5 hi\u1ec3u nh\u01b0 sau: N\u1ebfu b\u1ea1n \u0111ang ch\u1ea1y Ubuntu v\u00e0 c\u00f3 nhu c\u1ea7u ch\u1ea1y service v\u00e0i ch\u1ee5 MB tr\u00ean Fedora th\u00f4i th\u00ec b\u1ea1n c\u0169ng ph\u1ea3i t\u1ed1n \u00edt nh\u1ea5t: V\u00e0i GB cho h\u1ec7 \u0111i\u1ec1u h\u00e0nh Fedora , v\u00e0i tr\u0103m MB c\u1ea5p cho Ram M\u00e1y \u1ea3o, v\u00e0 1 v\u00e0i nh\u00e2n c\u1ee7a CPU cho CPU c\u1ee7a m\u00e1y \u1ea3o.<\/p>\n\n\n\n

\u0110i\u1ec3m y\u1ebfu n\u1eefa c\u1ee7a “m\u00e1y \u1ea3o truy\u1ec1n th\u1ed1ng” \u0111\u00f3 l\u00e0 th\u1eddi gian ch\u1ea1y service, ch\u00fang ta ph\u1ea3i kh\u1edfi \u0111\u1ed9ng c\u1ea3 h\u1ec7 \u0111i\u1ec1u h\u00e0nh \u1ea3o m\u1edbi ch\u1ea1y \u0111\u01b0\u1ee3c service n\u00e0y. V\u00e0 do \u0111\u00f3 th\u1eddi gian startup<\/strong>, stop<\/strong>, hay restart<\/strong> nhanh c\u0169ng ph\u1ea3i v\u00e0i ph\u00fat. \u0110\u00e2y l\u00e0 s\u01a1 \u0111\u1ed3 minh ho\u1ea1 ho\u1ea1t \u0111\u1ed9ng c\u1ee7a “m\u00e1y \u1ea3o” tr\u00ean m\u00e1y ch\u1ee7 (host system) \"\" T\u1eeb nh\u1eefng \u0111i\u1ec3m y\u1ebfu tr\u00ean m\u00e0 “\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng Container”<\/strong> sinh ra nh\u01b0 l\u00e0 m\u1ed9t gi\u1ea3i ph\u00e1p ho\u00e0n h\u1ea3o \u0111\u1ec3 ch\u1ea1y c\u00e1c service tr\u00ean m\u00e1y \u1ea3o m\u00e0 ti\u00eau t\u1ed1n t\u00e0i nguy\u00ean \u00edt nh\u1ea5t. \u0110\u1ed3ng th\u1eddi c\u00f3 performance cao nh\u1ea5t<\/p>\n\n\n\n

3. \u1ea2o ho\u00e1 s\u1eed d\u1ee5ng Container<\/h3>\n\n\n\n

\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng Container c\u00f2n c\u00f3 c\u00e1ch g\u1ecdi kh\u00e1c l\u00e0 “\u1ea3o ho\u00e1 m\u1ee9c h\u1ec7 \u0111i\u1ec1u h\u00e0nh” (operating system virtualization). Ch\u00fang ta c\u00f3 th\u1ec3 th\u1ea5y ngay s\u1ef1 kh\u00e1c nhau t\u1eeb c\u00e1i t\u00ean: m\u1ed9t b\u00ean l\u00e0 “\u1ea3o ho\u00e1 h\u1ec7 \u0111i\u1ec1u h\u00e0nh” c\u00f2n m\u1ed9t b\u00ean l\u00e0 “m\u00e1y \u1ea3o”.<\/p>\n\n\n\n

\u1ede \u0111\u00e2y, ch\u00fang ta kh\u00f4ng \u1ea3o ho\u00e1 c\u1ea3 ph\u1ea7n c\u1ee9ng , h\u1ec7 \u0111i\u1ec1u h\u00e0nh “nh\u01b0 th\u1eadt” n\u1eefa m\u00e0 ch\u1ec9 \u1ea3o ho\u00e1 m\u00f4i tr\u01b0\u1eddng. C\u00e1c service trong Container v\u1eabn ch\u1ea1y chung h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7 \u1edf ph\u00eda d\u01b0\u1edbi, chung Kernel nh\u01b0ng m\u00f4i tr\u01b0\u1eddng ch\u1ea1y c\u1ee7a c\u00e1c service th\u00ec lu\u00f4n \u0111\u01b0\u1ee3c \u0111\u1ea3m b\u1ea3o ho\u00e0n to\u00e0n \u0111\u1ed9c l\u1eadp v\u1edbi nhau nh\u01b0 s\u01a1 \u0111\u1ed3 bi\u1ec3u di\u1ec5n d\u01b0\u1edbi \u0111\u00e2y:<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

Thu\u1eadt ng\u1eef “Container”<\/strong> \u1edf \u0111\u00e2y \u0111\u01b0\u1ee3c hi\u1ec3u l\u00e0 kh\u00e1i ni\u1ec7m \u0111\u00f3ng g\u00f3i<\/strong>. M\u1ed9t Container ch\u1ee9a \u0111\u1ea7y \u0111\u1ee7 application v\u00e0 t\u1ea5t c\u00e1c c\u00e1c th\u00e0nh ph\u1ea7n ph\u1ee5 thu\u1ed9c nh\u01b0: c\u00e1c file Bins, c\u00e1c th\u01b0 vi\u1ec7n k\u00e8m theo \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o c\u00e1c \u1ee9ng d\u1ee5ng c\u00f3 th\u1ec3 ch\u1ea1y \u0111\u1ed9c l\u1eadp trong container \u0111\u00f3. Nh\u01b0 v\u1eady m\u1ed7i Container \u1edf \u0111\u00e2y \u0111\u01b0\u1ee3c coi nh\u01b0 m\u1ed9t “m\u00e1y \u1ea3o” mini (hehe)<\/p>\n\n\n\n

\u0110i\u1ec3m m\u1ea1nh l\u1edbn nh\u1ea5t c\u1ee7a Container \u0111\u00f3 ch\u00ednh l\u00e0 “hi\u1ec7u n\u0103ng”: L\u00e0 \u1ea3o ho\u00e1 nh\u01b0ng Container l\u1ea1i r\u1ea5t nh\u1eb9. H\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7 qu\u1ea3n l\u00fd c\u00e1c Container b\u1eb1ng Systemd ho\u1eb7c Upstart. Do v\u1eady, c\u00e1c Container \u1edf \u0111\u00e2y nh\u01b0 l\u00e0 m\u00f4t process c\u1ee7a h\u1ec7 th\u1ed1ng. Ch\u1ec9 m\u1ea5t v\u00e0i gi\u00e2y \u0111\u1ec3 start, stop hay restart m\u1ed9t Container, v\u00e0 khi c\u00e1c container \u1edf tr\u1ea1ng th\u00e1i Idle (ch\u1edd) ch\u00fang g\u1ea7n nh\u01b0 kh\u00f4ng ti\u00eau t\u1ed1n t\u00e0i nguy\u00ean CPU. V\u1edbi m\u1ed9t m\u00e1y t\u00ednh c\u1ea5u h\u00ecnh th\u00f4ng th\u01b0\u1eddng, n\u1ebfu ch\u1ea1y m\u00e1y \u1ea3o truy\u1ec1n th\u1ed1ng ch\u00fang ta ch\u1ec9 ch\u1ea1y \u0111\u01b0\u1ee3c kho\u1ea3ng v\u00e0i c\u00e1i l\u00e0 c\u00f9ng. Tuy nhi\u00ean n\u1ebfu ch\u1ea1y b\u1eb1ng Container ch\u00fang ta c\u00f3 th\u1ec3 ch\u1ea1y v\u00e0i ch\u1ee5c th\u1eadm ch\u00ed \u0111\u1ebfn c\u1ea3 v\u00e0i tr\u0103m c\u00e1i. (yeah)<\/p>\n\n\n\n

M\u1ed9t \u0111i\u1ec3m m\u1ea1nh n\u1eefa c\u1ee7a Container \u0111\u00f3 l\u00e0 t\u00ednh di \u0111\u1ed9ng v\u00e0 t\u00ednh m\u1edf r\u1ed9ng: Ch\u00fang ta c\u00f3 th\u1ec3 t\u1ef1 t\u1ea1o m\u1ed9t Container t\u1eeb c\u00e1c template c\u00f3 s\u1eb5n, c\u00e0i \u0111\u1eb7t m\u00f4i tr\u01b0\u1eddng, service, sau \u0111\u00f3 l\u01b0u tr\u1ea1ng th\u00e1i Container l\u1ea1i nh\u01b0 l\u00e0 m\u1ed9t “image”v\u00e0 tri\u1ec3n khai image n\u00e0y \u0111\u1ebfn b\u1ea5t k\u1ef3 ch\u1ed7 n\u00e0o ch\u00fang ta mong mu\u1ed1n. Hi\u1ec7n c\u00f3 nhi\u1ec1u d\u1ecbch v\u1ee5 cung c\u1ea5p cho ch\u00fang ta c\u00f3 th\u1ec3 l\u01b0u Container l\u1ea1i tr\u00ean Cloud nh\u01b0 docker<\/a> c\u1ef1c k\u1ef3 thu\u1eadn ti\u1ec7n (tanghoa)<\/p>\n\n\n\n

\u0110i\u1ec3m y\u1ebfu c\u00f3 th\u1ec3 coi l\u00e0 duy nh\u1ea5t c\u1ee7a “\u1ea3o ho\u00e1 s\u1eed d\u1ee5ng Container” \u0111\u00f3 ch\u00ednh l\u00e0 gi\u1edbi h\u1ea1n c\u1ee7a vi\u1ec7c \u1ea3o ho\u00e1 h\u1ec7 \u0111i\u1ec1u h\u00e0nh: Do c\u00e1c Container s\u1eed d\u1ee5ng chung kernel v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7 n\u00ean ch\u00fang ta ch\u1ec9 c\u00f3 th\u1ec3 “\u1ea3o ho\u00e1” \u0111\u01b0\u1ee3c c\u00e1c h\u1ec7 \u0111i\u1ec1u h\u00e0nh m\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7 h\u1ed7 tr\u1ee3. V\u00ed d\u1ee5: N\u1ebfu h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ee7 l\u00e0 Linux th\u00ec ch\u00fang ta ch\u1ec9 c\u00f3 th\u1ec3 \u1ea3o ho\u00e1 \u0111\u01b0\u1ee3c c\u00e1c h\u1ec7 \u0111i\u1ec1u h\u00e0nh nh\u00e2n Linux nh\u01b0 Lubuntu, OpenSuse, LinuxMint … ch\u1ee9 kh\u00f4ng th\u1ec3 t\u1ea1o \u0111\u01b0\u1ee3c m\u1ed9t container Window \u0111\u01b0\u1ee3c.<\/p>\n\n\n\n

4. K\u1ebft lu\u1eadn<\/h3>\n\n\n\n

“\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng Container” hi\u1ec7n ngay \u0111ang \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng ng\u00e0y m\u1ed9t r\u1ed9ng r\u00e3i. Nh\u1eefng c\u00f4ng ty t\u1eadp \u0111o\u00e0n l\u1edbn (\u0111\u1eb7c bi\u1ec7n l\u00e0 Google) \u0111\u00e3 tri\u1ec3n khai gi\u1ea3i ph\u00e1p n\u00e0y tr\u00ean h\u1ea7u h\u1ebft c\u00e1c d\u1ecbch v\u1ee5 c\u1ee7a h\u1ecd. Do v\u1eady, t\u00e1c gi\u1ea3 ngh\u0129 r\u1eb1ng s\u1ebd kh\u00f4ng c\u00f3 g\u00ec b\u1ea5t ng\u1edd khi n\u00f3i Container s\u1ebd l\u00e0 t\u01b0\u01a1ng lai c\u1ee7a c\u00f4ng ngh\u1ec7 “\u1ea3o ho\u00e1”, d\u1ea7n thay th\u1ebf gi\u1ea3i ph\u00e1p \u1ea3o ho\u00e1 truy\u1ec1n th\u1ed1ng.(lay2)<\/p>\n\n\n\n

Ngu\u1ed3n tham kh\u1ea3o<\/h3>\n\n\n\n

http:\/\/www.linuxjournal.com\/content\/containers\u2014not-virtual-machines\u2014are-future-cloud?page=0,1<\/a><\/p>\n\n\n\n

http:\/\/blog.smartbear.com\/web-monitoring\/why-containers-instead-of-hypervisors\/<\/a><\/p>\n\n\n\n

https:\/\/www.linux.com\/component\/content\/article\/186-virtualization\/300057-containers-vs-hypervisors-choosing-the-best-virtualization-technology-<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

1. Gi\u1edbi thi\u1ec7u Nh\u01b0 c\u00e1c b\u1ea1n \u0111\u00e3 bi\u1ebft, trong nh\u1eefng n\u0103m g\u1ea7n \u0111\u00e2y kh\u00e1i ni\u1ec7m “\u1ea2o ho\u00e1 s\u1eed d\u1ee5ng container” \u0111\u01b0\u1ee3c nh\u1eafc \u0111\u1ebfn kh\u00e1 nhi\u1ec1u. V\u1eady n\u00f3 l\u00e0 c\u00e1i g\u00ec, c\u00f3 nh\u1eefng \u01b0u \u0111i\u1ec3m g\u00ec v\u00e0 s\u1eed d\u1ee5ng n\u00f3 nh\u01b0 th\u1ebf n\u00e0o. B\u00e0i vi\u1ebft n\u00e0y c\u1ee7a m\u00ecnh xin \u0111\u01b0\u1ee3c n\u00eau nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n v\u1ec1 “\u1ea3o […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122,128],"tags":[],"class_list":["post-1916","post","type-post","status-publish","format-standard","hentry","category-blog","category-tech"],"_links":{"self":[{"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/posts\/1916"}],"collection":[{"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/comments?post=1916"}],"version-history":[{"count":1,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/posts\/1916\/revisions"}],"predecessor-version":[{"id":1917,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/posts\/1916\/revisions\/1917"}],"wp:attachment":[{"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/media?parent=1916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/categories?post=1916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uetacad.com\/wp-json\/wp\/v2\/tags?post=1916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}