web_toolset/web/js/sakana.min.js

4 lines
97 KiB
JavaScript
Raw Normal View History

2022-09-03 10:34:49 +08:00
(function(J,m){typeof exports=="object"&&typeof module=="object"?module.exports=m():typeof define=="function"&&define.amd?define("SakanaWidget",[],m):typeof exports=="object"?exports.SakanaWidget=m():J.SakanaWidget=m()})(self,()=>(()=>{"use strict";var et={951:(p,h,u)=>{u.d(h,{Z:()=>V});var f=u(204),l=u.n(f),n=u(415),c=u.n(n),d=c()(l());d.push([p.id,".sakana-widget *,.sakana-widget *::before,.sakana-widget *::after{box-sizing:border-box}.sakana-widget-wrapper{pointer-events:none;position:relative;width:100%;height:100%}.sakana-widget-app{pointer-events:none;position:relative}.sakana-widget-canvas{z-index:10;pointer-events:none;position:absolute}.sakana-widget-main{z-index:20;pointer-events:none;position:absolute;display:flex;flex-direction:column;justify-content:space-between;align-items:center}.sakana-widget-img{z-index:40;cursor:move;pointer-events:auto;position:relative;background:no-repeat 50% 50%;background-size:cover}.sakana-widget-ctrl{z-index:30;cursor:pointer;pointer-events:auto;position:relative;height:24px;width:112px;display:flex;border-radius:4px;background-color:#ddd;box-shadow:0 8px 24px rgba(0,0,0,.1)}.sakana-widget-ctrl-item{height:24px;width:28px;display:flex;justify-content:center;align-items:center;color:#555;background-color:rgba(0,0,0,0)}.sakana-widget-ctrl-item:hover{color:#555;background-color:rgba(255,255,255,.25)}.sakana-widget-icon{height:18px;width:18px}.sakana-widget-icon--rotate{animation:sakana-widget-spin 2s linear infinite}@keyframes sakana-widget-spin{100%{transform:rotate(360deg)}}",""]);const V=d},415:p=>{p.exports=function(h){var u=[];return u.toString=function(){return this.map(function(l){var n="",c=typeof l[5]!="undefined";return l[4]&&(n+="@supports (".concat(l[4],") {")),l[2]&&(n+="@media ".concat(l[2]," {")),c&&(n+="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {")),n+=h(l),c&&(n+="}"),l[2]&&(n+="}"),l[4]&&(n+="}"),n}).join("")},u.i=function(l,n,c,d,V){typeof l=="string"&&(l=[[null,l,void 0]]);var b={};if(c)for(var w=0;w<this.length;w++){var A=this[w][0];A!=null&&(b[A]=!0)}for(var x=0;x<l.length;x++){var v=[].concat(l[x]);c&&b[v[0]]||(typeof V!="undefined"&&(typeof v[5]=="undefined"||(v[1]="@layer".concat(v[5].length>0?" ".concat(v[5]):""," {").concat(v[1],"}")),v[5]=V),n&&(v[2]&&(v[1]="@media ".concat(v[2]," {").concat(v[1],"}")),v[2]=n),d&&(v[4]?(v[1]="@supports (".concat(v[4],") {").concat(v[1],"}"),v[4]=d):v[4]="".concat(d)),u.push(v))}},u}},204:p=>{p.exports=function(h){return h[1]}},624:p=>{var h=[];function u(n){for(var c=-1,d=0;d<h.length;d++)if(h[d].identifier===n){c=d;break}return c}function f(n,c){for(var d={},V=[],b=0;b<n.length;b++){var w=n[b],A=c.base?w[0]+c.base:w[0],x=d[A]||0,v="".concat(A," ").concat(x);d[A]=x+1;var E=u(v),D={css:w[1],media:w[2],sourceMap:w[3],supports:w[4],layer:w[5]};if(E!==-1)h[E].references++,h[E].updater(D);else{var Y=l(D,c);c.byIndex=b,h.splice(b,0,{identifier:v,updater:Y,references:1})}V.push(v)}return V}function l(n,c){var d=c.domAPI(c);d.update(n);var V=function(w){if(w){if(w.css===n.css&&w.media===n.media&&w.sourceMap===n.sourceMap&&w.supports===n.supports&&w.layer===n.layer)return;d.update(n=w)}else d.remove()};return V}p.exports=function(n,c){c=c||{},n=n||[];var d=f(n,c);return function(b){b=b||[];for(var w=0;w<d.length;w++){var A=d[w],x=u(A);h[x].references--}for(var v=f(b,c),E=0;E<d.length;E++){var D=d[E],Y=u(D);h[Y].references===0&&(h[Y].updater(),h.splice(Y,1))}d=v}}},892:p=>{var h={};function u(l){if(typeof h[l]=="undefined"){var n=document.querySelector(l);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(c){n=null}h[l]=n}return h[l]}function f(l,n){var c=u(l);if(!c)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");c.appendChild(n)}p.exports=f},716:p=>{function h(u){var f=document.createElement("style");return u.setAttributes(f,u.attributes),u.insert(f,u.options),f}p.exports=h},359:(p,h,u)=>{function f(l){var n=u.nc;n&&l.setAttribute("nonce",n)}p.exports=f},990:p=>{function h(l,n,c){var d="";c.suppo
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(b))))," */")),n.styleTagTransform(d,l,n.options)}function u(l){if(l.parentNode===null)return!1;l.parentNode.removeChild(l)}function f(l){var n=l.insertStyleElement(l);return{update:function(d){h(n,l,d)},remove:function(){u(n)}}}p.exports=f},230:p=>{function h(u,f){if(f.styleSheet)f.styleSheet.cssText=u;else{for(;f.firstChild;)f.removeChild(f.firstChild);f.appendChild(document.createTextNode(u))}}p.exports=h}},J={};function m(p){var h=J[p];if(h!==void 0)return h.exports;var u=J[p]={id:p,exports:{}};return et[p](u,u.exports,m),u.exports}m.n=p=>{var h=p&&p.__esModule?()=>p.default:()=>p;return m.d(h,{a:h}),h},m.d=(p,h)=>{for(var u in h)m.o(h,u)&&!m.o(p,u)&&Object.defineProperty(p,u,{enumerable:!0,get:h[u]})},m.o=(p,h)=>Object.prototype.hasOwnProperty.call(p,h),m.nc=void 0;var M={};return(()=>{m.d(M,{default:()=>jt});var p=m(624),h=m.n(p),u=m(990),f=m.n(u),l=m(892),n=m.n(l),c=m(359),d=m.n(c),V=m(716),b=m.n(V),w=m(230),A=m.n(w),x=m(951),v={};v.styleTagTransform=A(),v.setAttributes=d(),v.insert=n().bind(null,"head"),v.domAPI=f(),v.insertStyleElement=b();var E=h()(x.Z,v);const D=x.Z&&x.Z.locals?x.Z.locals:void 0;var Y=[],bt=function(){return Y.some(function(r){return r.activeTargets.length>0})},Vt=function(){return Y.some(function(r){return r.skippedTargets.length>0})},rt="ResizeObserver loop completed with undelivered notifications.",xt=function(){var r;typeof ErrorEvent=="function"?r=new ErrorEvent("error",{message:rt}):(r=document.createEvent("Event"),r.initEvent("error",!1,!1),r.message=rt),window.dispatchEvent(r)},k;(function(r){r.BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(k||(k={}));var K=function(r){return Object.freeze(r)},Yt=function(){function r(t,e){this.inlineSize=t,this.blockSize=e,K(this)}return r}(),st=function(){function r(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,K(this)}return r.prototype.toJSON=function(){var t=this,e=t.x,s=t.y,i=t.top,a=t.right,o=t.bottom,W=t.left,g=t.width,C=t.height;return{x:e,y:s,top:i,right:a,bottom:o,left:W,width:g,height:C}},r.fromRect=function(t){return new r(t.x,t.y,t.width,t.height)},r}(),P=function(r){return r instanceof SVGElement&&"getBBox"in r},it=function(r){if(P(r)){var t=r.getBBox(),e=t.width,s=t.height;return!e&&!s}var i=r,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||r.getClientRects().length)},nt=function(r){var t;if(r instanceof Element)return!0;var e=(t=r==null?void 0:r.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(e&&r instanceof e.Element)},At=function(r){switch(r.tagName){case"INPUT":if(r.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},R=typeof window!="undefined"?window:{},Z=new WeakMap,at=/auto|scroll/,St=/^tb|vertical/,Et=/msie|trident/i.test(R.navigator&&R.navigator.userAgent),S=function(r){return parseFloat(r||"0")},B=function(r,t,e){return r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=!1),new Yt((e?t:r)||0,(e?r:t)||0)},ot=K({devicePixelContentBoxSize:B(),borderBoxSize:B(),contentBoxSize:B(),contentRect:new st(0,0,0,0)}),ct=function(r,t){if(t===void 0&&(t=!1),Z.has(r)&&!t)return Z.get(r);if(it(r))return Z.set(r,ot),ot;var e=getComputedStyle(r),s=P(r)&&r.ownerSVGElement&&r.getBBox(),i=!Et&&e.boxSizing==="border-box",a=St.test(e.writingMode||""),o=!s&&at.test(e.overflowY||""),W=!s&&at.test(e.overflowX||""),g=s?0:S(e.paddingTop),C=s?0:S(e.paddingRight),y=s?0:S(e.paddingBottom),F=s?0:S(e.paddingLeft),I=s?0:S(e.borderTopWidth),_t=s?0:S(e.borderRightWidth),$t=s?0:S(e.borderBottomWidth),te=s?0:S(e.borderLeftWidth),Ct=F+C,ft=g+y,$=te+_t,tt=I+$t,wt=W?r.offsetHeight-tt-r.clientHeight:0,yt=o?r.offsetWidth-$-r.clientWidth:0,ee=i?Ct+$:0,re=i?ft+tt:0,T=s?s.width:S(e.width)-ee-yt,G=s?s.height:S(e.height)-re-wt,se=T+Ct+yt+$,ie=G+ft+wt+tt,Ft=K({devicePixelContentBoxSize:B(Math.round(T*devicePixel
/*! sakana-widget | DSRKafuU (https://dsrkafuu.net) | Copyright (c) MIT License */