Anvil/sb-addons/essentials-backgrounds-4/manager-bundle.js

13 lines
13 KiB
JavaScript
Raw Normal View History

2024-06-16 17:30:30 +02:00
try{
(()=>{var ne=Object.create;var F=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var E=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,a)=>(typeof require<"u"?require:o)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var ae=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports);var se=(e,o,a,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of re(o))!ie.call(e,c)&&c!==a&&F(e,c,{get:()=>o[c],enumerable:!(r=te(o,c))||r.enumerable});return e};var le=(e,o,a)=>(a=e!=null?ne(ce(e)):{},se(o||!e||!e.__esModule?F(a,"default",{value:e,enumerable:!0}):a,e));var I=x(()=>{});var d=x(()=>{});var m=x(()=>{});var V=ae((W,G)=>{I();d();m();(function(e){if(typeof W=="object"&&typeof G<"u")G.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var o;typeof window<"u"||typeof window<"u"?o=window:typeof self<"u"?o=self:o=this,o.memoizerific=e()}})(function(){var e,o,a;return function r(c,h,s){function t(i,f){if(!h[i]){if(!c[i]){var u=typeof E=="function"&&E;if(!f&&u)return u(i,!0);if(n)return n(i,!0);var b=new Error("Cannot find module '"+i+"'");throw b.code="MODULE_NOT_FOUND",b}var p=h[i]={exports:{}};c[i][0].call(p.exports,function(g){var S=c[i][1][g];return t(S||g)},p,p.exports,r,c,h,s)}return h[i].exports}for(var n=typeof E=="function"&&E,l=0;l<s.length;l++)t(s[l]);return t}({1:[function(r,c,h){c.exports=function(s){if(typeof Map!="function"||s){var t=r("./similar");return new t}else return new Map}},{"./similar":2}],2:[function(r,c,h){function s(){return this.list=[],this.lastItem=void 0,this.size=0,this}s.prototype.get=function(t){var n;if(this.lastItem&&this.isEqual(this.lastItem.key,t))return this.lastItem.val;if(n=this.indexOf(t),n>=0)return this.lastItem=this.list[n],this.list[n].val},s.prototype.set=function(t,n){var l;return this.lastItem&&this.isEqual(this.lastItem.key,t)?(this.lastItem.val=n,this):(l=this.indexOf(t),l>=0?(this.lastItem=this.list[l],this.list[l].val=n,this):(this.lastItem={key:t,val:n},this.list.push(this.lastItem),this.size++,this))},s.prototype.delete=function(t){var n;if(this.lastItem&&this.isEqual(this.lastItem.key,t)&&(this.lastItem=void 0),n=this.indexOf(t),n>=0)return this.size--,this.list.splice(n,1)[0]},s.prototype.has=function(t){var n;return this.lastItem&&this.isEqual(this.lastItem.key,t)?!0:(n=this.indexOf(t),n>=0?(this.lastItem=this.list[n],!0):!1)},s.prototype.forEach=function(t,n){var l;for(l=0;l<this.size;l++)t.call(n||this,this.list[l].val,this.list[l].key,this)},s.prototype.indexOf=function(t){var n;for(n=0;n<this.size;n++)if(this.isEqual(this.list[n].key,t))return n;return-1},s.prototype.isEqual=function(t,n){return t===n||t!==t&&n!==n},c.exports=s},{}],3:[function(r,c,h){var s=r("map-or-similar");c.exports=function(i){var f=new s(!1),u=[];return function(b){var p=function(){var g=f,S,w,T=arguments.length-1,B=Array(T+1),A=!0,O;if((p.numArgs||p.numArgs===0)&&p.numArgs!==T+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(O=0;O<T;O++){if(B[O]={cacheItem:g,arg:arguments[O]},g.has(arguments[O])){g=g.get(arguments[O]);continue}A=!1,S=new s(!1),g.set(arguments[O],S),g=S}return A&&(g.has(arguments[T])?w=g.get(arguments[T]):A=!1),A||(w=b.apply(null,arguments),g.set(arguments[T],w)),i>0&&(B[T]={cacheItem:g,arg:arguments[T]},A?t(u,B):u.push(B),u.length>i&&n(u.shift())),p.wasMemoized=A,p.numArgs=T+1,w};return p.limit=i,p.wasMemoized=!1,p.cache=f,p.lru=u,p}};function t(i,f){var u=i.length,b=f.length,p,g,S;for(g=0;g<u;g++){for(p=!0,S=0;S<b;S++)if(!l(i[g][S].arg,f[S].arg)){p=!1;break}if(p)break}i.push(i.splice(g,1)[0])}function n(i){var f=i.length,u=i[f-1],b,p;for(u.cacheItem.delete(u.arg),p=f-2;p>=0&&(u=i[p],b=u.cacheItem.get(u.arg),!b||!b.size);p--)u.cacheItem.delete(u.arg)}function l(i,f){return i===f||i!==i&&f!==f}},{"map-or-similar":1}]},{},[3])(3)})});I();
[ ]{`+Math.min.apply(Math,c)+"}","g");r=r.map(function(t){return t.replace(h,`
`)})}r[0]=r[0].replace(/^\r?\n/,"");var s=r[0];return o.forEach(function(t,n){var l=s.match(/(?:^|\n)( *)$/),i=l?l[1]:"",f=t;typeof t=="string"&&t.includes(`
`)&&(f=String(t).split(`
`).map(function(u,b){return b===0?u:""+i+u}).join(`
`)),s+=f+r[n+1]}),s}var ee="storybook/background",v="backgrounds",ue=Q.span(({background:e})=>({borderRadius:"1rem",display:"block",height:"1rem",width:"1rem",background:e}),({theme:e})=>({boxShadow:`${e.appBorderColor} 0 0 0 1px inset`})),Ie=(e,o=[],a)=>{if(e==="transparent")return"transparent";if(o.find(c=>c.value===e))return e;let r=o.find(c=>c.name===a);if(r)return r.value;if(a){let c=o.map(h=>h.name).join(", ");H.warn(X`
Backgrounds Addon: could not find the default color "${a}".
These are the available colors for your story based on your configuration:
${c}.
`)}return"transparent"},oe=(0,U.default)(1e3)((e,o,a,r,c,h)=>({id:e||o,title:o,onClick:()=>{c({selected:a,name:o})},value:a,right:r?C.createElement(ue,{background:a}):void 0,active:h})),de=(0,U.default)(10)((e,o,a)=>{let r=e.map(({name:c,value:h})=>oe(null,c,h,!0,a,h===o));return o!=="transparent"?[oe("reset","Clear background","transparent",null,a,!1),...r]:r}),me={default:null,disable:!0,values:[]},pe=L(function(){let e=D(v,me),[o,a]=K(!1),[r,c]=M(),h=r[v]?.value,s=z(()=>Ie(h,e.values,e.default),[e,h]);Array.isArray(e)&&H.warn("Addon Backgrounds api has changed in Storybook 6.0. Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md");let t=q(n=>{c({[v]:{...r[v],value:n}})},[e,r,c]);return e.disable?null:C.createElement(R,null,C.createElement(j,{placement:"top",closeOnOutsideClick:!0,tooltip:({onHide:n})=>C.createElement($,{links:de(e.values,s,({selected:l})=>{s!==l&&t(l),n()})}),onVisibleChange:a},C.createElement(N,{key:"background",title:"Change the background of the preview",active:s!=="transparent"||o},C.createElement(J,null))))}),fe=L(function(){let[e,o]=M(),{grid:a}=D(v,{grid:{disable:!1}});if(a?.disable)return null;let r=e[v]?.grid||!1;return C.createElement(N,{key:"background",active:r,title:"Apply a grid to the preview",onClick:()=>o({[v]:{...e[v],grid:!r}})},C.createElement(Z,null))});P.register(ee,()=>{P.add(ee,{title:"Backgrounds",type:Y.TOOL,match:({viewMode:e,tabId:o})=>!!(e&&e.match(/^(story|docs)$/))&&!o,render:()=>C.createElement(R,null,C.createElement(pe,null),C.createElement(fe,null))})});})();
}catch(e){ console.error("[Storybook] One of your manager-entries failed: " + import.meta.url, e); }