WordPress/wp-includes/js/dist/url.min.js

2 lines
8.4 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.url=function(t){var r={};function n(e){if(r[e])return r[e].exports;var u=r[e]={i:e,l:!1,exports:{}};return t[e].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=t,n.c=r,n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,r){if(1&r&&(t=n(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var u in t)n.d(e,u,function(r){return t[r]}.bind(null,u));return e},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},n.p="",n(n.s=465)}({11:function(t,r,n){"use strict";n.d(r,"a",(function(){return i}));var e=n(38);var u=n(31),o=n(39);function i(t,r){return Object(e.a)(t)||function(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],e=!0,u=!1,o=void 0;try{for(var i,c=t[Symbol.iterator]();!(e=(i=c.next()).done)&&(n.push(i.value),!r||n.length!==r);e=!0);}catch(t){u=!0,o=t}finally{try{e||null==c.return||c.return()}finally{if(u)throw o}}return n}}(t,r)||Object(u.a)(t,r)||Object(o.a)()}},2:function(t,r){t.exports=window.lodash},24:function(t,r,n){"use strict";function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}n.d(r,"a",(function(){return e}))},31:function(t,r,n){"use strict";n.d(r,"a",(function(){return u}));var e=n(24);function u(t,r){if(t){if("string"==typeof t)return Object(e.a)(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(e.a)(t,r):void 0}}},38:function(t,r,n){"use strict";function e(t){if(Array.isArray(t))return t}n.d(r,"a",(function(){return e}))},39:function(t,r,n){"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(r,"a",(function(){return e}))},465:function(t,r,n){"use strict";function e(t){try{return new URL(t),!0}catch(t){return!1}}n.r(r),n.d(r,"isURL",(function(){return e})),n.d(r,"isEmail",(function(){return o})),n.d(r,"getProtocol",(function(){return i})),n.d(r,"isValidProtocol",(function(){return c})),n.d(r,"getAuthority",(function(){return a})),n.d(r,"isValidAuthority",(function(){return f})),n.d(r,"getPath",(function(){return l})),n.d(r,"isValidPath",(function(){return s})),n.d(r,"getQueryString",(function(){return d})),n.d(r,"buildQueryString",(function(){return v})),n.d(r,"isValidQueryString",(function(){return g})),n.d(r,"getPathAndQueryString",(function(){return h})),n.d(r,"getFragment",(function(){return m})),n.d(r,"isValidFragment",(function(){return O})),n.d(r,"addQueryArgs",(function(){return P})),n.d(r,"getQueryArg",(function(){return x})),n.d(r,"getQueryArgs",(function(){return A})),n.d(r,"hasQueryArg",(function(){return I})),n.d(r,"removeQueryArgs",(function(){return U})),n.d(r,"prependHTTP",(function(){return R})),n.d(r,"safeDecodeURI",(function(){return Q})),n.d(r,"safeDecodeURIComponent",(function(){return C})),n.d(r,"filterURLForDisplay",(function(){return D})),n.d(r,"cleanForSlug",(function(){return z}));var u=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function o(t){return u.test(t)}function i(t){var r=/^([^\s:]+:)/.exec(t);if(r)return r[1]}function c(t){return!!t&&/^[a-z\-.\+]+[0-9]*:$/i.test(t)}function a(t){var r=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(t);if(r)return r[1]}function f(t){return!!t&&/^[^\s#?]+$/.test(t)}function l(t){var r=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(t);if(r)return r[1]}function s(t){return!!t&&/^[^\s#?]+$/.test(t)}function d(t){var r;try{r=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(r)return r}var y=n(11);function p(t,r){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,r){if(!t)return;if("string"==typeof t)return b(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,r)}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var e=0,u=function(){};return{s:u,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:u}}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 o,i=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function b(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function v(t){for(var r,n="",e=Object.entries(t);r=e.shift();){var u=r,o=Object(y.a)(u,2),i=o[0],c=o[1];if(Array.isArray(c)||c&&c.constructor===Object){var a,f=p(Object.entries(c).reverse());try{for(f.s();!(a=f.n()).done;){var l=Object(y.a)(a.value,2),s=l[0],d=l[1];e.unshift(["".concat(i,"[").concat(s,"]"),d])}}catch(t){f.e(t)}finally{f.f()}}else void 0!==c&&(null===c&&(c=""),n+="&"+[i,c].map(encodeURIComponent).join("="))}return n.substr(1)}function g(t){return!!t&&/^[^\s#?\/]+$/.test(t)}function h(t){var r=l(t),n=d(t),e="/";return r&&(e+=r),n&&(e+="?".concat(n)),e}function m(t){var r=/^\S+?(#[^\s\?]*)/.exec(t);if(r)return r[1]}function O(t){return!!t&&/^#[^\s#?\/]*$/.test(t)}var j=n(5);function w(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function S(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?w(Object(n),!0).forEach((function(r){Object(j.a)(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function A(t){return(d(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,r){var n=r.split("=").filter(Boolean).map(decodeURIComponent),e=Object(y.a)(n,2),u=e[0],o=e[1],i=void 0===o?"":o;u&&function(t,r,n){for(var e=r.length,u=e-1,o=0;o<e;o++){var i=r[o];!i&&Array.isArray(t)&&(i=t.length.toString());var c=!isNaN(Number(r[o+1]));t[i]=o===u?n:t[i]||(c?[]:{}),Array.isArray(t[i])&&!c&&(t[i]=S({},t[i])),t=t[i]}}(t,u.replace(/\]/g,"").split("["),i);return t}),{})}function P(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;if(!r||!Object.keys(r).length)return t;var n=t,e=t.indexOf("?");return-1!==e&&(r=Object.assign(A(t),r),n=n.substr(0,e)),n+"?"+v(r)}function x(t,r){return A(t)[r]}function I(t,r){return void 0!==x(t,r)}function U(t){var r=t.indexOf("?");if(-1===r)return t;for(var n=A(t),e=t.substr(0,r),u=arguments.length,o=new Array(u>1?u-1:0),i=1;i<u;i++)o[i-1]=arguments[i];o.forEach((function(t){return delete n[t]}));var c=v(n);return c?e+"?"+c:e}var $=/^(?:[a-z]+:|#|\?|\.|\/)/i;function R(t){return t?(t=t.trim(),$.test(t)||o(t)?t:"http://"+t):t}function Q(t){try{return decodeURI(t)}catch(r){return t}}function C(t){try{return decodeURIComponent(t)}catch(r){return t}}function D(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t.replace(/^(?:https?:)\/\/(?:www\.)?/,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));var e=/([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/;if(!r||n.length<=r||!n.match(e))return n;var u=(n=n.split("?")[0]).split("/"),o=u[u.length-1];if(o.length<=r)return"…"+n.slice(-r);var i=o.lastIndexOf("."),c=[o.slice(0,i),o.slice(i+1)],a=c[0],f=c[1],l=a.slice(-3)+"."+f;return o.slice(0,r-l.length-1)+"…"+l}var _=n(2);function z(t){return t?Object(_.trim)(Object(_.deburr)(t).replace(/[\s\./]+/g,"-").replace(/[^\w-]+/g,"").toLowerCase(),"-"):""}},5:function(t,r,n){"use strict";function e(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}n.d(r,"a",(function(){return e}))}});