Liferay.Loader.define("frontend-js-spa-web@5.0.32/util/pathParser",["module","exports","require"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=f,t.toRegex=function(e){return i(f(e))},t.extractData=function(e,t){const n={},r=f(e),a=t.match(i(r));if(!a)return null;let o=1;for(let e=0;e<r.length;e++)if("string"!=typeof r[e]){let t=a[o++];void 0!==t&&(r[e].repeat&&(t=t.split("/")),n[r[e].name]=t)}return n};const e=/([/])?(?:(?::(\w+)(?:\(((?:\\.|[^\\()])*)\))?|\(((?:\\.|[^\\()])+)\))([+*?])?)/g;function r(e){return{match:e[0],modifier:e[5],name:e[2],paramPattern:e[3],prefix:e[1],unnamedPattern:e[4]}}function i(e){let t="";for(let n=0;n<e.length;n++)if("string"==typeof e[n])t+=o(e[n]);else{let r=a(e[n].pattern);e[n].repeat&&(r+=a("\\/"+r)+"*"),r=o(e[n].prefix)+"(".concat(r,")"),e[n].optional&&(e[n].partial||(r=a(r)),r+="?"),t+=r}return new RegExp("^"+function(e){e.endsWith("/")?e+="?":e+="\\/?";return e}(t)+"$")}function a(e){return"(?:".concat(e,")")}function o(e){return e.replace(/([.+*?=^!:${}()[]|\/\\])/g,"\\$1")}function f(t){if("string"!=typeof t)return t;const n=t;let i=0;const a=[];let o="",f=0,u=e.exec(n);for(;u;){const t=r(u);o=n.slice(f,u.index),f=u.index+t.match.length,a.push(o),a.push({name:t.name?t.name:""+i++,optional:"*"===t.modifier||"?"===t.modifier,partial:n[f]&&n[f]!==t.prefix,pattern:t.paramPattern||t.unnamedPattern||"[^\\/]+",prefix:t.prefix||"",repeat:"*"===t.modifier||"+"===t.modifier}),u=e.exec(n)}return f<n.length&&a.push(n.substr(f)),a}}}));
//# sourceMappingURL=pathParser.js.map