mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-11-18 02:07:05 +01:00
13 lines
27 KiB
JavaScript
13 lines
27 KiB
JavaScript
|
/*!
|
||
|
* @chiiya/haven v0.5.11
|
||
|
* (c) Elisha Witte <elishawitte@gmail.com>
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
/*!
|
||
|
* @chiiya/haven v0.5.11
|
||
|
* (c) Elisha Witte <elishawitte@gmail.com>
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).haven={})}(this,(function(e){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function t(e,n){for(var o=0;o<n.length;o++){var t=n[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function i(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}function a(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}function r(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,t)}return o}function c(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(n){a(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||l(e)||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 l(e,n){if(e){if("string"==typeof e)return u(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?u(e,n):void 0}}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,t=new Array(n);o<n;o++)t[o]=e[o];return t}function f(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=l(e))){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 t,i,a=!0,r=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return a=e.done,e},e:function(e){r=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(r)throw i}}}}function d(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}var v=function(){function e(){o(this,e)}return i(e,null,[{key:"set",value:function(e,n,o){var t=this.resolveOptions(o),i=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),a=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),r=this.encodeAttributes(t);document.cookie="".concat(a,"=").concat(i).concat(r)}},{key:"get",value:function(e){var n,o=f(document.cookie?document.cookie.split("; "):[]);try{for(o.s();!(n=o.n()).done;){var t=n.value.split("=");if(e===d(t[0])){var i=t.slice(1).join("=");return'"'===i.charAt(0)&&(i=i.slice(1,-1)),i=d(i)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"getAll",value:function(){var e,n={},o=f(document.cookie?document.cookie.split("; "):[]);try{for(o.s();!(e=o.n()).done;){var t=e.value.split("="),i=d(t[0]),a=t.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1)),a=d(a),n[i]=a}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"remove",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.resolveOptions(Object.assign(n,{expires:-1}));if(e instanceof RegExp)return this.removeByRegex(e,o);var t=this.encodeAttributes(o);document.cookie="".concat(e,"=''").concat(t),th
|
||
|
//# sourceMappingURL=haven.umd.min.js.map
|