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

1 line
3.9 KiB
JavaScript

this.wp=this.wp||{},this.wp.shortcode=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=298)}({2:function(t,e){!function(){t.exports=this.lodash}()},298:function(t,e,n){"use strict";n.r(e),n.d(e,"next",function(){return u}),n.d(e,"replace",function(){return o}),n.d(e,"string",function(){return c}),n.d(e,"regexp",function(){return s}),n.d(e,"attrs",function(){return a}),n.d(e,"fromMatch",function(){return f});var r=n(2),i=n(41);function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=s(t);r.lastIndex=n;var i=r.exec(e);if(i){if("["===i[1]&&"]"===i[7])return u(t,e,r.lastIndex);var o={index:i.index,content:i[0],shortcode:f(i)};return i[1]&&(o.content=o.content.slice(1),o.index++),i[7]&&(o.content=o.content.slice(0,-1)),o}}function o(t,e,n){var r=arguments;return e.replace(s(t),function(t,e,i,u,o,c,s,a){if("["===e&&"]"===a)return t;var l=n(f(r));return l?e+l+a:t})}function c(t){return new l(t).string()}function s(t){return new RegExp("\\[(\\[?)("+t+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}var a=n.n(i)()(function(t){var e,n={},r=[],i=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;for(t=t.replace(/[\u00a0\u200b]/g," ");e=i.exec(t);)e[1]?n[e[1].toLowerCase()]=e[2]:e[3]?n[e[3].toLowerCase()]=e[4]:e[5]?n[e[5].toLowerCase()]=e[6]:e[7]?r.push(e[7]):e[8]?r.push(e[8]):e[9]&&r.push(e[9]);return{named:n,numeric:r}});function f(t){var e;return e=t[4]?"self-closing":t[6]?"closed":"single",new l({tag:t[2],attrs:t[3],type:e,content:t[5]})}var l=Object(r.extend)(function(t){var e=this;Object(r.extend)(this,Object(r.pick)(t||{},"tag","attrs","type","content"));var n=this.attrs;this.attrs={named:{},numeric:[]},n&&(Object(r.isString)(n)?this.attrs=a(n):Object(r.isEqual)(Object.keys(n),["named","numeric"])?this.attrs=n:Object(r.forEach)(n,function(t,n){e.set(n,t)}))},{next:u,replace:o,string:c,regexp:s,attrs:a,fromMatch:f});Object(r.extend)(l.prototype,{get:function(t){return this.attrs[Object(r.isNumber)(t)?"numeric":"named"][t]},set:function(t,e){return this.attrs[Object(r.isNumber)(t)?"numeric":"named"][t]=e,this},string:function(){var t="["+this.tag;return Object(r.forEach)(this.attrs.numeric,function(e){/\s/.test(e)?t+=' "'+e+'"':t+=" "+e}),Object(r.forEach)(this.attrs.named,function(e,n){t+=" "+n+'="'+e+'"'}),"single"===this.type?t+"]":"self-closing"===this.type?t+" /]":(t+="]",this.content&&(t+=this.content),t+"[/"+this.tag+"]")}}),e.default=l},41:function(t,e,n){t.exports=function(t,e){var n,r,i,u=0;function o(){var e,o,c=r,s=arguments.length;t:for(;c;){if(c.args.length===arguments.length){for(o=0;o<s;o++)if(c.args[o]!==arguments[o]){c=c.next;continue t}return c!==r&&(c===i&&(i=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=r,c.prev=null,r.prev=c,r=c),c.val}c=c.next}for(e=new Array(s),o=0;o<s;o++)e[o]=arguments[o];return c={args:e,val:t.apply(null,e)},r?(r.prev=c,c.next=r):i=c,u===n?(i=i.prev).next=null:u++,r=c,c.val}return e&&e.maxSize&&(n=e.maxSize),o.clear=function(){r=null,i=null,u=0},o}}});