yl-ai-modal 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  | 版本号 | 变更内容 |
6
6
  | - | - |
7
+ |1.0.15| - 调整小铁匠动画间隔,随机播放 |
8
+ |1.0.14| - 调试实际接入时的色系问题 |
7
9
  |1.0.13| - 添加dark参数,适配暗色系 |
8
10
  |1.0.12| - 添加dark参数,适配暗色系,但推送时忘记打包了,所以依然是旧版本,请弃用该版本|
9
11
  |1.0.11| - 补充文档说明,请仔细查看文档,该文档没有一个字是多余的|
@@ -60,8 +62,10 @@ const init = () => {
60
62
  } else {
61
63
  // 初始化弹框
62
64
  aiModalHandle = ylAiModal({
63
- //传入 url
65
+ //必填参数:系统url
64
66
  // url: 'https://www.antdv.com/docs/vue/introduce-cn/',
67
+ // 可选参数:如果需要暗色系的话,默认 false
68
+ // dark: true,
65
69
  });
66
70
  }
67
71
  };
@@ -1 +1 @@
1
- .ai-dialog[data-v-50f59213]{border:none;width:100%;height:100%}.ai-human[data-v-50f59213]{position:absolute;left:0;bottom:0;background-size:contain!important;transform:translate(-100%);cursor:move}.ai-dialog-feed[data-v-50f59213]{height:100%;overflow:hidden;box-sizing:border-box;box-shadow:0 0 12px #9797974d;border-radius:16px;background-color:#fff}.ai-dialog-iframe[data-v-50f59213]{display:block;width:100%;height:100%;border:none}.vdr{touch-action:none;position:absolute;box-sizing:border-box;border:1px dashed black}.handle{box-sizing:border-box;position:absolute;width:10px;height:10px;background:#eee;border:1px solid #333}.handle-tl{top:-10px;left:-10px;cursor:nw-resize}.handle-tm{top:-10px;left:50%;margin-left:-5px;cursor:n-resize}.handle-tr{top:-10px;right:-10px;cursor:ne-resize}.handle-ml{top:50%;margin-top:-5px;left:-10px;cursor:w-resize}.handle-mr{top:50%;margin-top:-5px;right:-10px;cursor:e-resize}.handle-bl{bottom:-10px;left:-10px;cursor:sw-resize}.handle-bm{bottom:-10px;left:50%;margin-left:-5px;cursor:s-resize}.handle-br{bottom:-10px;right:-10px;cursor:se-resize}@media only screen and (max-width:768px){[class*=handle-]:before{content:"";inset:-10px;position:absolute}}.fade-enter-active[data-v-fd6bf392],.fade-leave-active[data-v-fd6bf392]{transition:opacity .3s ease}.fade-enter-from[data-v-fd6bf392],.fade-leave-to[data-v-fd6bf392]{opacity:0}.dialog-vdr[data-v-fd6bf392]{border:none;left:0;top:0;display:flex;align-items:flex-end;pointer-events:none}.yl-ai-modal[data-v-fd6bf392],.ai-human[data-v-fd6bf392],.icon-close[data-v-fd6bf392]{pointer-events:auto}.yl-ai-modal[data-v-fd6bf392]{flex:0 0 400px;height:100%}.icon-close[data-v-fd6bf392]{position:absolute;right:0;top:0;width:40px;height:40px;cursor:pointer;background:#0000001a url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABZ0lEQVR4AaSVQW7CMBBFk+x6hp6m6gap4hQVS86AOAPb9hSoEpuql2nP0GX631CDgXg8DmjGcezJe4kdlGEcx5XyW/mmfOju/MFQwoK5GsTbKB+Vr8q9JmdL/q/diwML5gbBQQMpntWZJcngMISxOCBYq/upTEFBk6QAh7ke+r7/FXmpZEAHi7DEgS9h8wQdHWGbJTW4mJ0J6LRKInC4JwEnUUkUDvNCwEBN0gKHdyNg0JF8aJ7kJVDXgpfDNtTOrppJATUFyZPmSB0sXDgVRQGTmeSL86tkrHjnqdYVpKJ7jq4g29B8WZKPseo/vijI4PmGsixkkjDnSiYFBTgb+iIySV9dC1dyI3DgtqHZxockF4Ia3O5XTYvkJIjCxbeISkzQCjeDmoiEbzKfSD5zbJYus2B9bc3tzGlqEp5gp+tnwXWdhSPZIVhY1bEJ3/mx/NwWJAsEW5X9KN+VoWVR3WRkElgwt38AAAD//5QocPkAAAAGSURBVAMAQOLr9fdNGykAAAAASUVORK5CYII=) no-repeat center;border-radius:0 16px;background-size:12px;transition:all .3s}.icon-close[data-v-fd6bf392]:hover{opacity:.7}.ai-human[data-v-fd6bf392]{width:120px;height:120px;flex:none;background-size:contain!important;cursor:move}
1
+ .ai-dialog[data-v-d35b16c0]{border:none;width:100%;height:100%}.ai-human[data-v-d35b16c0]{position:absolute;left:0;bottom:0;background-size:contain!important;transform:translate(-100%);cursor:move}.ai-dialog-feed[data-v-d35b16c0]{height:100%;box-sizing:border-box}.ai-dialog-iframe[data-v-d35b16c0]{display:block;width:100%;height:100%;border:none}.vdr{touch-action:none;position:absolute;box-sizing:border-box;border:1px dashed black}.handle{box-sizing:border-box;position:absolute;width:10px;height:10px;background:#eee;border:1px solid #333}.handle-tl{top:-10px;left:-10px;cursor:nw-resize}.handle-tm{top:-10px;left:50%;margin-left:-5px;cursor:n-resize}.handle-tr{top:-10px;right:-10px;cursor:ne-resize}.handle-ml{top:50%;margin-top:-5px;left:-10px;cursor:w-resize}.handle-mr{top:50%;margin-top:-5px;right:-10px;cursor:e-resize}.handle-bl{bottom:-10px;left:-10px;cursor:sw-resize}.handle-bm{bottom:-10px;left:50%;margin-left:-5px;cursor:s-resize}.handle-br{bottom:-10px;right:-10px;cursor:se-resize}@media only screen and (max-width:768px){[class*=handle-]:before{content:"";inset:-10px;position:absolute}}.fade-enter-active[data-v-acb02c82],.fade-leave-active[data-v-acb02c82]{transition:opacity .3s ease}.fade-enter-from[data-v-acb02c82],.fade-leave-to[data-v-acb02c82]{opacity:0}.dialog-vdr[data-v-acb02c82]{border:none;left:0;top:0;display:flex;align-items:flex-end;pointer-events:none}.yl-ai-modal[data-v-acb02c82],.ai-human[data-v-acb02c82],.icon-close[data-v-acb02c82]{pointer-events:auto}.yl-ai-modal[data-v-acb02c82]{flex:0 0 400px;height:100%}.icon-close[data-v-acb02c82]{position:absolute;right:0;top:0;width:40px;height:40px;cursor:pointer;background:#0000001a url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABZ0lEQVR4AaSVQW7CMBBFk+x6hp6m6gap4hQVS86AOAPb9hSoEpuql2nP0GX631CDgXg8DmjGcezJe4kdlGEcx5XyW/mmfOju/MFQwoK5GsTbKB+Vr8q9JmdL/q/diwML5gbBQQMpntWZJcngMISxOCBYq/upTEFBk6QAh7ke+r7/FXmpZEAHi7DEgS9h8wQdHWGbJTW4mJ0J6LRKInC4JwEnUUkUDvNCwEBN0gKHdyNg0JF8aJ7kJVDXgpfDNtTOrppJATUFyZPmSB0sXDgVRQGTmeSL86tkrHjnqdYVpKJ7jq4g29B8WZKPseo/vijI4PmGsixkkjDnSiYFBTgb+iIySV9dC1dyI3DgtqHZxockF4Ia3O5XTYvkJIjCxbeISkzQCjeDmoiEbzKfSD5zbJYus2B9bc3tzGlqEp5gp+tnwXWdhSPZIVhY1bEJ3/mx/NwWJAsEW5X9KN+VoWVR3WRkElgwt38AAAD//5QocPkAAAAGSURBVAMAQOLr9fdNGykAAAAASUVORK5CYII=) no-repeat center;border-radius:0 16px;background-size:12px;transition:all .3s}.icon-close[data-v-acb02c82]:hover{opacity:.7}.ai-human[data-v-acb02c82]{width:120px;height:120px;flex:none;background-size:contain!important;cursor:move}
@@ -56,7 +56,7 @@ const Ct = (t, e) => {
56
56
  ])
57
57
  ]));
58
58
  }
59
- }, oe = /* @__PURE__ */ Ct(se, [["__scopeId", "data-v-50f59213"]]);
59
+ }, oe = /* @__PURE__ */ Ct(se, [["__scopeId", "data-v-d35b16c0"]]);
60
60
  process.env.NODE_ENV !== "production" && Object.freeze({});
61
61
  process.env.NODE_ENV !== "production" && Object.freeze([]);
62
62
  const tt = (t) => typeof t == "function", ae = (t) => typeof t == "string", X = /* @__PURE__ */ new WeakMap(), he = /* @__NO_SIDE_EFFECTS__ */ (...t) => {
@@ -759,8 +759,8 @@ const k = {
759
759
  background: `url(${ht[r.ironManIndex]}) no-repeat center`
760
760
  }));
761
761
  setInterval(() => {
762
- r.ironManIndex = (r.ironManIndex + 1) % ht.length;
763
- }, 2e3);
762
+ r.ironManIndex = Math.floor(Math.random() * ht.length);
763
+ }, 5e3);
764
764
  const A = pt("vueDraggableResizableRef"), U = () => {
765
765
  A.value && A.value.checkParentSize();
766
766
  }, E = pt("aiHuman"), rt = () => {
@@ -890,7 +890,7 @@ const k = {
890
890
  _: 3
891
891
  }, 8, ["x", "y", "z", "w", "h"]));
892
892
  }
893
- }), Pe = /* @__PURE__ */ Ct(De, [["__scopeId", "data-v-fd6bf392"]]);
893
+ }), Pe = /* @__PURE__ */ Ct(De, [["__scopeId", "data-v-acb02c82"]]);
894
894
  let P = null;
895
895
  const $e = (t) => {
896
896
  let e;
@@ -1 +1 @@
1
- (function(o,T){typeof exports=="object"&&typeof module<"u"?module.exports=T(require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["vue","axios"],T):(o=typeof globalThis<"u"?globalThis:o||self,o["yl-ai-modal"]=T(o.Vue,o.axios))})(this,(function(o,T){"use strict";var p=typeof document<"u"?document.currentScript:null;const B=T.create({timeout:6e3}),q=t=>{if(t.response){const e=localStorage.getItem("token");t.response.status==401&&e&&(localStorage.remove("token"),setTimeout(()=>{window.location.reload()},1500))}return Promise.reject(t)};B.interceptors.request.use(t=>{const e=localStorage.getItem("token");return e&&(t.headers.token=e),t},q),B.interceptors.response.use(t=>t.data,q);const K=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},lt={class:"ai-dialog"},ct={class:"ai-dialog-feed"},dt=["src"],ut=K({__name:"index",setup(t){const e=o.useAttrs(),i=o.reactive({baseUrl:"",url:""}),n=async()=>{if(i.baseUrl)return(await B.post(i.baseUrl+"/api/v1/user/login",{username:"clare",password:"Zz12345678"}))?.data};return o.onBeforeMount(async()=>{let s=e.url;const a=new URL(s);i.baseUrl=a.origin;let h=a.href;h.endsWith("/")&&(h=h.slice(0,-1));let c=await n();const d=new URLSearchParams({...c,dark:e.dark||""}).toString();i.url=h+`?${d}`}),o.onMounted(()=>{o.nextTick(()=>{})}),(s,a)=>(o.openBlock(),o.createElementBlock("div",lt,[o.createElementVNode("div",ct,[o.createElementVNode("iframe",{class:"ai-dialog-iframe",src:i.url},null,8,dt)])]))}},[["__scopeId","data-v-50f59213"]]);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const U=t=>typeof t=="function",mt=t=>typeof t=="string",_=new WeakMap,ft=(...t)=>{var e;const i=t[0],n=(e=o.getCurrentInstance())===null||e===void 0?void 0:e.proxy,s=n??o.getCurrentScope();if(s==null&&!o.hasInjectionContext())throw new Error("injectLocal must be called in setup");return s&&_.has(s)&&i in _.get(s)?_.get(s)[i]:o.inject(...t)},gt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const pt=Object.prototype.toString,bt=t=>pt.call(t)==="[object Object]";function G(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function D(t){return Array.isArray(t)?t:[t]}function yt(t){return o.getCurrentInstance()}function wt(t,e=!0,i){yt()?o.onMounted(t,i):e?t():o.nextTick(t)}function xt(t,e,i){return o.watch(t,e,{...i,immediate:!0})}const P=gt?window:void 0;function Rt(t){var e;const i=o.toValue(t);return(e=i?.$el)!==null&&e!==void 0?e:i}function L(...t){const e=(n,s,a,h)=>(n.addEventListener(s,a,h),()=>n.removeEventListener(s,a,h)),i=o.computed(()=>{const n=D(o.toValue(t[0])).filter(s=>s!=null);return n.every(s=>typeof s!="string")?n:void 0});return xt(()=>{var n,s;return[(n=(s=i.value)===null||s===void 0?void 0:s.map(a=>Rt(a)))!==null&&n!==void 0?n:[P].filter(a=>a!=null),D(o.toValue(i.value?t[1]:t[0])),D(o.unref(i.value?t[2]:t[1])),o.toValue(i.value?t[3]:t[2])]},([n,s,a,h],c,d)=>{if(!n?.length||!s?.length||!a?.length)return;const l=bt(h)?{...h}:h,m=n.flatMap(u=>s.flatMap(f=>a.map(r=>e(u,f,r,l))));d(()=>{m.forEach(u=>u())})},{flush:"post"})}function zt(){const t=o.shallowRef(!1),e=o.getCurrentInstance();return e&&o.onMounted(()=>{t.value=!0},e),t}function St(t){const e=zt();return o.computed(()=>(e.value,!!t()))}const vt=Symbol("vueuse-ssr-width");function Ct(){const t=o.hasInjectionContext()?ft(vt,null):null;return typeof t=="number"?t:void 0}function kt(t,e={}){const{window:i=P,ssrWidth:n=Ct()}=e,s=St(()=>i&&"matchMedia"in i&&typeof i.matchMedia=="function"),a=o.shallowRef(typeof n=="number"),h=o.shallowRef(),c=o.shallowRef(!1),d=l=>{c.value=l.matches};return o.watchEffect(()=>{if(a.value){a.value=!s.value,c.value=o.toValue(t).split(",").some(l=>{const m=l.includes("not all"),u=l.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=l.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let r=!!(u||f);return u&&r&&(r=n>=G(u[1])),f&&r&&(r=n<=G(f[1])),m?!r:r});return}s.value&&(h.value=i.matchMedia(o.toValue(t)),c.value=h.value.matches)}),L(h,"change",d,{passive:!0}),o.computed(()=>c.value)}function Mt(t={}){const{window:e=P,initialWidth:i=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:a=!0,type:h="inner"}=t,c=o.shallowRef(i),d=o.shallowRef(n),l=()=>{if(e)if(h==="outer")c.value=e.outerWidth,d.value=e.outerHeight;else if(h==="visual"&&e.visualViewport){const{width:u,height:f,scale:r}=e.visualViewport;c.value=Math.round(u*r),d.value=Math.round(f*r)}else a?(c.value=e.innerWidth,d.value=e.innerHeight):(c.value=e.document.documentElement.clientWidth,d.value=e.document.documentElement.clientHeight)};l(),wt(l);const m={passive:!0};return L("resize",l,m),e&&h==="visual"&&e.visualViewport&&L(e.visualViewport,"resize",l,m),s&&o.watch(kt("(orientation: portrait)"),()=>l()),{width:c,height:d}}function Q(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function M(t,e,i,n=1){const[s,a]=typeof n=="number"?[n,n]:n,h=Math.round(e/s/t[0])*t[0],c=Math.round(i/a/t[1])*t[1];return[h,c]}function V(t,e,i){return t-e-i}function $(t,e,i){return t-e-i}function y(t,e,i){return e!==null&&t<e?e:i!==null&&i<t?i:t}function J(t,e,i){let n=t;const s=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].find(a=>Q(n[a]));if(!Q(n[s]))return!1;do{if(n[s](e))return!0;if(n===i)return!1;n=n.parentNode}while(n);return!1}function It(t){const e=window.getComputedStyle(t);return[parseFloat(e.getPropertyValue("width"),10),parseFloat(e.getPropertyValue("height"),10)]}function v(t,e,i){t&&(t.attachEvent?t.attachEvent("on"+e,i):t.addEventListener?t.addEventListener(e,i,!0):t["on"+e]=i)}function x(t,e,i){t&&(t.detachEvent?t.detachEvent("on"+e,i):t.removeEventListener?t.removeEventListener(e,i,!0):t["on"+e]=null)}const Tt=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},N={mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"},touch:{start:"touchstart",move:"touchmove",stop:"touchend"}},Et={userSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none",MsUserSelect:"none"},Lt={userSelect:"auto",MozUserSelect:"auto",WebkitUserSelect:"auto",MsUserSelect:"auto"};let R=N.mouse;const Nt={replace:!0,name:"vue-draggable-resizable",props:{className:{type:String,default:"vdr"},classNameDraggable:{type:String,default:"draggable"},classNameResizable:{type:String,default:"resizable"},classNameDragging:{type:String,default:"dragging"},classNameResizing:{type:String,default:"resizing"},classNameActive:{type:String,default:"active"},classNameHandle:{type:String,default:"handle"},disableUserSelect:{type:Boolean,default:!0},enableNativeDrag:{type:Boolean,default:!1},preventDeactivation:{type:Boolean,default:!1},active:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},lockAspectRatio:{type:Boolean,default:!1},w:{type:[Number,String],default:200,validator:t=>typeof t=="number"?t>0:t==="auto"},h:{type:[Number,String],default:200,validator:t=>typeof t=="number"?t>0:t==="auto"},minWidth:{type:Number,default:0,validator:t=>t>=0},minHeight:{type:Number,default:0,validator:t=>t>=0},maxWidth:{type:Number,default:null,validator:t=>t>=0},maxHeight:{type:Number,default:null,validator:t=>t>=0},x:{type:Number,default:0},y:{type:Number,default:0},z:{type:[String,Number],default:"auto",validator:t=>typeof t=="string"?t==="auto":t>=0},handles:{type:Array,default:()=>["tl","tm","tr","mr","br","bm","bl","ml"],validator:t=>{const e=new Set(["tl","tm","tr","mr","br","bm","bl","ml"]);return new Set(t.filter(i=>e.has(i))).size===t.length}},dragHandle:{type:String,default:null},dragCancel:{type:String,default:null},axis:{type:String,default:"both",validator:t=>["x","y","both"].includes(t)},grid:{type:Array,default:()=>[1,1]},parent:{type:Boolean,default:!1},scale:{type:[Number,Array],default:1,validator:t=>typeof t=="number"?t>0:t.length===2&&t[0]>0&&t[1]>0},onDragStart:{type:Function,default:()=>!0},onDrag:{type:Function,default:()=>!0},onResizeStart:{type:Function,default:()=>!0},onResize:{type:Function,default:()=>!0}},data:function(){return{left:this.x,top:this.y,right:null,bottom:null,width:null,height:null,widthTouched:!1,heightTouched:!1,aspectFactor:null,parentWidth:null,parentHeight:null,handle:null,enabled:this.active,resizing:!1,dragging:!1,dragEnable:!1,resizeEnable:!1,zIndex:this.z}},created:function(){this.maxWidth&&this.minWidth>this.maxWidth&&console.warn("[Vdr warn]: Invalid prop: minWidth cannot be greater than maxWidth"),this.maxHeight&&this.minHeight>this.maxHeight&&console.warn("[Vdr warn]: Invalid prop: minHeight cannot be greater than maxHeight"),this.resetBoundsAndMouseState()},mounted:function(){this.enableNativeDrag||(this.$el.ondragstart=()=>!1);const[t,e]=this.getParentSize();this.parentWidth=t,this.parentHeight=e;const[i,n]=It(this.$el);this.aspectFactor=(this.w!=="auto"?this.w:i)/(this.h!=="auto"?this.h:n),this.width=this.w!=="auto"?this.w:i,this.height=this.h!=="auto"?this.h:n,this.right=this.parentWidth-this.width-this.left,this.bottom=this.parentHeight-this.height-this.top,this.active&&this.$emit("activated"),v(document.documentElement,"mousedown",this.deselect),v(document.documentElement,"touchend touchcancel",this.deselect),v(window,"resize",this.checkParentSize)},beforeUnmount:function(){x(document.documentElement,"mousedown",this.deselect),x(document.documentElement,"touchstart",this.handleUp),x(document.documentElement,"mousemove",this.move),x(document.documentElement,"touchmove",this.move),x(document.documentElement,"mouseup",this.handleUp),x(document.documentElement,"touchend touchcancel",this.deselect),x(window,"resize",this.checkParentSize)},methods:{resetBoundsAndMouseState(){this.mouseClickPosition={mouseX:0,mouseY:0,x:0,y:0,w:0,h:0},this.bounds={minLeft:null,maxLeft:null,minRight:null,maxRight:null,minTop:null,maxTop:null,minBottom:null,maxBottom:null}},checkParentSize(){if(this.parent){const[t,e]=this.getParentSize();this.parentWidth=t,this.parentHeight=e,this.right=this.parentWidth-this.width-this.left,this.bottom=this.parentHeight-this.height-this.top}},getParentSize(){if(this.parent){const t=window.getComputedStyle(this.$el.parentNode,null);return[parseInt(t.getPropertyValue("width"),10),parseInt(t.getPropertyValue("height"),10)]}return[null,null]},elementTouchDown(t){R=N.touch,this.elementDown(t)},elementMouseDown(t){R=N.mouse,this.elementDown(t)},elementDown(t){if(t instanceof MouseEvent&&t.button!==0)return;const e=t.target||t.srcElement;if(this.$el.contains(e)){if(this.onDragStart(t)===!1)return;if(this.dragHandle&&!J(e,this.dragHandle,this.$el)||this.dragCancel&&J(e,this.dragCancel,this.$el)){this.dragging=!1;return}this.enabled||(this.enabled=!0,this.$emit("activated"),this.$emit("update:active",!0)),this.draggable&&(this.dragEnable=!0),this.mouseClickPosition.mouseX=t.touches?t.touches[0].pageX:t.pageX,this.mouseClickPosition.mouseY=t.touches?t.touches[0].pageY:t.pageY,this.mouseClickPosition.left=this.left,this.mouseClickPosition.right=this.right,this.mouseClickPosition.top=this.top,this.mouseClickPosition.bottom=this.bottom,this.parent&&(this.bounds=this.calcDragLimits()),v(document.documentElement,R.move,this.move),v(document.documentElement,R.stop,this.handleUp)}},calcDragLimits(){return{minLeft:this.left%this.grid[0],maxLeft:Math.floor((this.parentWidth-this.width-this.left)/this.grid[0])*this.grid[0]+this.left,minRight:this.right%this.grid[0],maxRight:Math.floor((this.parentWidth-this.width-this.right)/this.grid[0])*this.grid[0]+this.right,minTop:this.top%this.grid[1],maxTop:Math.floor((this.parentHeight-this.height-this.top)/this.grid[1])*this.grid[1]+this.top,minBottom:this.bottom%this.grid[1],maxBottom:Math.floor((this.parentHeight-this.height-this.bottom)/this.grid[1])*this.grid[1]+this.bottom}},deselect(t){const e=t.target||t.srcElement,i=new RegExp(this.className+"-([trmbl]{2})","");!this.$el.contains(e)&&!i.test(e.className)&&(this.enabled&&!this.preventDeactivation&&(this.enabled=!1,this.$emit("deactivated"),this.$emit("update:active",!1)),x(document.documentElement,R.move,this.handleResize)),this.resetBoundsAndMouseState()},handleTouchDown(t,e){R=N.touch,this.handleDown(t,e)},handleDown(t,e){e instanceof MouseEvent&&e.which!==1||this.onResizeStart(t,e)!==!1&&(e.stopPropagation&&e.stopPropagation(),this.lockAspectRatio&&!t.includes("m")?this.handle="m"+t.substring(1):this.handle=t,this.resizeEnable=!0,this.mouseClickPosition.mouseX=e.touches?e.touches[0].pageX:e.pageX,this.mouseClickPosition.mouseY=e.touches?e.touches[0].pageY:e.pageY,this.mouseClickPosition.left=this.left,this.mouseClickPosition.right=this.right,this.mouseClickPosition.top=this.top,this.mouseClickPosition.bottom=this.bottom,this.bounds=this.calcResizeLimits(),v(document.documentElement,R.move,this.handleResize),v(document.documentElement,R.stop,this.handleUp))},calcResizeLimits(){let t=this.minW,e=this.minH,i=this.maxW,n=this.maxH;const s=this.aspectFactor,[a,h]=this.grid,c=this.width,d=this.height,l=this.left,m=this.top,u=this.right,f=this.bottom;this.lockAspectRatio&&(t/e>s?e=t/s:t=s*e,i&&n?(i=Math.min(i,s*n),n=Math.min(n,i/s)):i?n=i/s:n&&(i=s*n)),i=i-i%a,n=n-n%h;const r={minLeft:null,maxLeft:null,minTop:null,maxTop:null,minRight:null,maxRight:null,minBottom:null,maxBottom:null};return this.parent?(r.minLeft=l%a,r.maxLeft=l+Math.floor((c-t)/a)*a,r.minTop=m%h,r.maxTop=m+Math.floor((d-e)/h)*h,r.minRight=u%a,r.maxRight=u+Math.floor((c-t)/a)*a,r.minBottom=f%h,r.maxBottom=f+Math.floor((d-e)/h)*h,i&&(r.minLeft=Math.max(r.minLeft,this.parentWidth-u-i),r.minRight=Math.max(r.minRight,this.parentWidth-l-i)),n&&(r.minTop=Math.max(r.minTop,this.parentHeight-f-n),r.minBottom=Math.max(r.minBottom,this.parentHeight-m-n)),this.lockAspectRatio&&(r.minLeft=Math.max(r.minLeft,l-m*s),r.minTop=Math.max(r.minTop,m-l/s),r.minRight=Math.max(r.minRight,u-f*s),r.minBottom=Math.max(r.minBottom,f-u/s))):(r.minLeft=null,r.maxLeft=l+Math.floor((c-t)/a)*a,r.minTop=null,r.maxTop=m+Math.floor((d-e)/h)*h,r.minRight=null,r.maxRight=u+Math.floor((c-t)/a)*a,r.minBottom=null,r.maxBottom=f+Math.floor((d-e)/h)*h,i&&(r.minLeft=-(u+i),r.minRight=-(l+i)),n&&(r.minTop=-(f+n),r.minBottom=-(m+n)),this.lockAspectRatio&&i&&n&&(r.minLeft=Math.min(r.minLeft,-(u+i)),r.minTop=Math.min(r.minTop,-(n+f)),r.minRight=Math.min(r.minRight,-l-i),r.minBottom=Math.min(r.minBottom,-m-n))),r},move(t){this.resizing?this.handleResize(t):this.dragEnable&&this.handleDrag(t)},handleDrag(t){const e=this.axis,i=this.grid,n=this.bounds,s=this.mouseClickPosition,a=e&&e!=="y"?s.mouseX-(t.touches?t.touches[0].pageX:t.pageX):0,h=e&&e!=="x"?s.mouseY-(t.touches?t.touches[0].pageY:t.pageY):0,[c,d]=M(i,a,h,this.scale),l=y(s.left-c,n.minLeft,n.maxLeft),m=y(s.top-d,n.minTop,n.maxTop);if(this.onDrag(l,m)===!1)return;const u=y(s.right+c,n.minRight,n.maxRight),f=y(s.bottom+d,n.minBottom,n.maxBottom);this.left=l,this.top=m,this.right=u,this.bottom=f,this.$emit("dragging",this.left,this.top),this.dragging=!0},moveHorizontally(t){const[e]=M(this.grid,t,this.top,1),i=y(e,this.bounds.minLeft,this.bounds.maxLeft);this.left=i,this.right=this.parentWidth-this.width-i},moveVertically(t){const[e,i]=M(this.grid,this.left,t,1),n=y(i,this.bounds.minTop,this.bounds.maxTop);this.top=n,this.bottom=this.parentHeight-this.height-n},handleResize(t){let e=this.left,i=this.top,n=this.right,s=this.bottom;const a=this.mouseClickPosition,h=this.aspectFactor,c=a.mouseX-(t.touches?t.touches[0].pageX:t.pageX),d=a.mouseY-(t.touches?t.touches[0].pageY:t.pageY);!this.widthTouched&&c&&(this.widthTouched=!0),!this.heightTouched&&d&&(this.heightTouched=!0);const[l,m]=M(this.grid,c,d,this.scale);this.handle.includes("b")?(s=y(a.bottom+m,this.bounds.minBottom,this.bounds.maxBottom),this.lockAspectRatio&&this.resizingOnY&&(n=this.right-(this.bottom-s)*h)):this.handle.includes("t")&&(i=y(a.top-m,this.bounds.minTop,this.bounds.maxTop),this.lockAspectRatio&&this.resizingOnY&&(e=this.left-(this.top-i)*h)),this.handle.includes("r")?(n=y(a.right+l,this.bounds.minRight,this.bounds.maxRight),this.lockAspectRatio&&this.resizingOnX&&(s=this.bottom-(this.right-n)/h)):this.handle.includes("l")&&(e=y(a.left-l,this.bounds.minLeft,this.bounds.maxLeft),this.lockAspectRatio&&this.resizingOnX&&(i=this.top-(this.left-e)/h));const u=V(this.parentWidth,e,n),f=$(this.parentHeight,i,s);this.onResize(this.handle,e,i,u,f)!==!1&&(this.left=e,this.top=i,this.right=n,this.bottom=s,this.width=u,this.height=f,this.$emit("resizing",this.left,this.top,this.width,this.height),this.resizing=!0)},changeWidth(t){const[e]=M(this.grid,t,0,1),i=y(this.parentWidth-e-this.left,this.bounds.minRight,this.bounds.maxRight);let n=this.bottom;this.lockAspectRatio&&(n=this.bottom-(this.right-i)/this.aspectFactor);const s=V(this.parentWidth,this.left,i),a=$(this.parentHeight,this.top,n);this.right=i,this.bottom=n,this.width=s,this.height=a},changeHeight(t){const[e,i]=M(this.grid,0,t,1),n=y(this.parentHeight-i-this.top,this.bounds.minBottom,this.bounds.maxBottom);let s=this.right;this.lockAspectRatio&&(s=this.right-(this.bottom-n)*this.aspectFactor);const a=V(this.parentWidth,this.left,s),h=$(this.parentHeight,this.top,n);this.right=s,this.bottom=n,this.width=a,this.height=h},handleUp(t){this.handle=null,this.resetBoundsAndMouseState(),this.dragEnable=!1,this.resizeEnable=!1,this.resizing&&(this.resizing=!1,this.$emit("resizeStop",this.left,this.top,this.width,this.height)),this.dragging&&(this.dragging=!1,this.$emit("dragStop",this.left,this.top)),x(document.documentElement,R.move,this.handleResize)}},computed:{style(){return{transform:`translate(${this.left}px, ${this.top}px)`,width:this.computedWidth,height:this.computedHeight,zIndex:this.zIndex,...this.dragging&&this.disableUserSelect?Et:Lt}},actualHandles(){return this.resizable?this.handles:[]},computedWidth(){return this.w==="auto"&&!this.widthTouched?"auto":this.width+"px"},computedHeight(){return this.h==="auto"&&!this.heightTouched?"auto":this.height+"px"},minW(){return this.minWidth},minH(){return this.minHeight},maxW(){return this.maxWidth},maxH(){return this.maxHeight},resizingOnX(){return!!this.handle&&(this.handle.includes("l")||this.handle.includes("r"))},resizingOnY(){return!!this.handle&&(this.handle.includes("t")||this.handle.includes("b"))},isCornerHandle(){return!!this.handle&&["tl","tr","br","bl"].includes(this.handle)}},watch:{active(t){this.enabled=t,t?this.$emit("activated"):this.$emit("deactivated")},z(t){(t>=0||t==="auto")&&(this.zIndex=t)},x(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcDragLimits()),this.moveHorizontally(t))},y(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcDragLimits()),this.moveVertically(t))},lockAspectRatio(t){t?this.aspectFactor=this.width/this.height:this.aspectFactor=void 0},w(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcResizeLimits()),this.changeWidth(t))},h(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcResizeLimits()),this.changeHeight(t))}}},Wt=["onMousedown","onTouchstart"];function Ht(t,e,i,n,s,a){return o.openBlock(),o.createElementBlock("div",{style:o.normalizeStyle(a.style),class:o.normalizeClass([{[i.classNameActive]:t.enabled,[i.classNameDragging]:t.dragging,[i.classNameResizing]:t.resizing,[i.classNameDraggable]:i.draggable,[i.classNameResizable]:i.resizable},i.className]),onMousedown:e[0]||(e[0]=(...h)=>a.elementMouseDown&&a.elementMouseDown(...h)),onTouchstart:e[1]||(e[1]=(...h)=>a.elementTouchDown&&a.elementTouchDown(...h))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.actualHandles,h=>(o.openBlock(),o.createElementBlock("div",{key:h,class:o.normalizeClass([i.classNameHandle,i.classNameHandle+"-"+h]),style:o.normalizeStyle({display:t.enabled?"block":"none"}),onMousedown:o.withModifiers(c=>a.handleDown(h,c),["stop","prevent"]),onTouchstart:o.withModifiers(c=>a.handleTouchDown(h,c),["stop","prevent"])},[o.renderSlot(t.$slots,h)],46,Wt))),128)),o.renderSlot(t.$slots,"default")],38)}const tt=Tt(Nt,[["render",Ht]]);function j(t){j.installed||(j.installed=!0,t.component("VueDraggableResizable",tt))}const Bt={install:j};let W=null;typeof window<"u"?W=window.Vue:typeof global<"u"&&(W=global.Vue),W&&W.use(Bt);const I={duration:3e3,message:"",onClose:void 0,showClose:!1,placement:void 0,zIndex:2e3},Ut={duration:{type:Number,default:I.duration},message:{type:[String,Object,Function],default:I.message},onClose:{type:Function,default:I.onClose},showClose:{type:Boolean,default:I.showClose},zIndex:{type:Number,default:I.zIndex}},et={current:0},it=o.ref(0),_t=2e3,Dt=Symbol("elZIndexContextKey"),Pt=Symbol("zIndexContextKey"),Vt=t=>{const e=o.getCurrentInstance()?o.inject(Dt,et):et,i=o.getCurrentInstance()?o.inject(Pt,void 0):void 0,n=o.computed(()=>o.unref(i)||_t),s=o.computed(()=>n.value+it.value);return{initialZIndex:n,currentZIndex:s,nextZIndex:()=>(e.current++,it.value=e.current,s.value)}},$t={class:"yl-ai-modal"},jt=400,Ft=K(Object.assign({name:"InstanceConstructor"},{__name:"instanceConstructor",props:Ut,emits:["destroy"],setup(t,{expose:e,emit:i}){const n=o.ref(!1),s=t,a=i,h=o.ref(!1),{currentZIndex:c,nextZIndex:d}=Vt();o.ref(0);const l=o.reactive({x:0,y:0,w:.01,height:.01,z:2e3,ironManIndex:0}),m=new URL("./assets/iron-man/01.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,u=new URL("./assets/iron-man/02.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,f=new URL("./assets/iron-man/03.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,r=new URL("./assets/iron-man/04.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,Xt=new URL("./assets/iron-man/05.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,Zt=new URL("./assets/iron-man/06.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href;let nt=[m,u,f,r,Xt,Zt];const qt=o.computed(()=>({background:`url(${nt[l.ironManIndex]}) no-repeat center`}));setInterval(()=>{l.ironManIndex=(l.ironManIndex+1)%nt.length},2e3);const O=o.useTemplateRef("vueDraggableResizableRef"),A=()=>{O.value&&O.value.checkParentSize()},E=o.useTemplateRef("aiHuman"),ot=()=>{const g=E.value.getBoundingClientRect(),{width:b,height:w}=g,S=jt+b,C=window.innerWidth,k=window.innerHeight,rt=Math.round(k*.8),ee=C-S-16,ie=(k-rt)/2;return{w:S,x:ee,y:ie,height:rt}},{width:st,height:at}=Mt({});o.watch([at,st],()=>{if(n.value)Z();else{const{w:g,height:b,x:w,y:z}=l;(g+w>st.value||b+z>at.value)&&ht()}});function Y(){n.value=!1,o.nextTick(()=>{h.value||s.onClose?.()})}const X=o.ref(!1),Kt=g=>{X.value=!0},Gt=(g,b)=>{l.x=g,l.y=b},Qt=()=>{X.value=!1},Z=()=>{if(X.value)return;const g=E.value.getBoundingClientRect(),{width:b,height:w}=g,{w:z,height:S}=ot();let C=l.y;n.value||(C=l.y+w-S,l.y+w<=S&&(C=0)),n.value=!0;let k=l.x;l.x+z>=window.innerWidth&&(k=window.innerWidth-z),Object.assign(l,{x:k,y:C}),A(),o.nextTick(()=>{Object.assign(l,{w:z,height:S}),A()})},Jt=()=>{const g=E.value.getBoundingClientRect(),{width:b,height:w}=g;Object.assign(l,{w:b,height:w,y:l.y+l.height-w})};o.onBeforeMount(()=>{});function ht(){o.nextTick(()=>{const g=E.value.getBoundingClientRect(),{width:b,height:w}=g,{height:z,x:S,y:C}=ot(),k=c.value;Object.assign(l,{w:b,height:w,x:S,y:C+z-w,z:k}),A()})}o.onMounted(()=>{d(),ht()});function te(g){(g.keyCode===27||g.key==="Escape")&&Y()}return L(document,"keydown",te),e({show:Z,close:Y,destroy:()=>{a("destroy")}}),(g,b)=>(o.openBlock(),o.createBlock(o.unref(tt),{class:"dialog-vdr",ref_key:"vueDraggableResizableRef",ref:O,onDrag:Kt,onDragStop:Gt,onClick:Qt,x:l.x,y:l.y,z:l.z,w:l.w,h:l.height,parent:!0,resizable:!1,"drag-handle":".yl-ai-human"},{default:o.withCtx(()=>[o.createElementVNode("div",{ref_key:"aiHuman",ref:E,class:"yl-ai-human ai-human",style:o.normalizeStyle(qt.value),onClick:Z},null,4),o.createVNode(o.Transition,{name:"fade",onBeforeEnter:b[0]||(b[0]=w=>h.value=!0),onBeforeLeave:g.onClose,onAfterLeave:Jt},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",$t,[o.renderSlot(g.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(g.message),1)],!0)],512),[[o.vShow,n.value]])]),_:3},8,["onBeforeLeave"]),n.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"icon-close",onClick:Y})):o.createCommentVNode("",!0)]),_:3},8,["x","y","z","w","h"]))}}),[["__scopeId","data-v-fd6bf392"]]);let H=null;const Ot=t=>{let e;return!t||mt(t)||o.isVNode(t)||U(t)?e={message:t}:e=t,{...I,...e}},At=t=>{const{handler:e}=t;e.close()},Yt=({appendTo:t=document.body,...e},i)=>{const n=e.onClose,s=document.createElement("div"),a={...e,onClose:()=>{n?.(),At(l)},onDestroy:()=>{H=null,o.render(null,s)}},h=o.createVNode(Ft,a,U(a.message)||o.isVNode(a.message)?{default:U(a.message)?a.message:()=>a.message}:null);h.appContext=i||F._context,o.render(h,s),t.appendChild(s.firstElementChild);const c=h.component,l={vnode:h,vm:c,handler:{close:()=>{c.exposed?.close()},destroy:()=>{c.exposed?.destroy()},open:()=>{c.exposed?.show()}},props:h.component.props};return l},F=(t={},e)=>{if(H)return H.handler;const i=Ot(t),n=Yt(i,e);return H=n,n.handler};return F._context=null,(t={})=>F({message:o.h(ut,t)})}));
1
+ (function(o,T){typeof exports=="object"&&typeof module<"u"?module.exports=T(require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["vue","axios"],T):(o=typeof globalThis<"u"?globalThis:o||self,o["yl-ai-modal"]=T(o.Vue,o.axios))})(this,(function(o,T){"use strict";var p=typeof document<"u"?document.currentScript:null;const B=T.create({timeout:6e3}),q=t=>{if(t.response){const e=localStorage.getItem("token");t.response.status==401&&e&&(localStorage.remove("token"),setTimeout(()=>{window.location.reload()},1500))}return Promise.reject(t)};B.interceptors.request.use(t=>{const e=localStorage.getItem("token");return e&&(t.headers.token=e),t},q),B.interceptors.response.use(t=>t.data,q);const K=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},lt={class:"ai-dialog"},ct={class:"ai-dialog-feed"},dt=["src"],ut=K({__name:"index",setup(t){const e=o.useAttrs(),i=o.reactive({baseUrl:"",url:""}),n=async()=>{if(i.baseUrl)return(await B.post(i.baseUrl+"/api/v1/user/login",{username:"clare",password:"Zz12345678"}))?.data};return o.onBeforeMount(async()=>{let s=e.url;const a=new URL(s);i.baseUrl=a.origin;let h=a.href;h.endsWith("/")&&(h=h.slice(0,-1));let c=await n();const d=new URLSearchParams({...c,dark:e.dark||""}).toString();i.url=h+`?${d}`}),o.onMounted(()=>{o.nextTick(()=>{})}),(s,a)=>(o.openBlock(),o.createElementBlock("div",lt,[o.createElementVNode("div",ct,[o.createElementVNode("iframe",{class:"ai-dialog-iframe",src:i.url},null,8,dt)])]))}},[["__scopeId","data-v-d35b16c0"]]);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const U=t=>typeof t=="function",mt=t=>typeof t=="string",_=new WeakMap,gt=(...t)=>{var e;const i=t[0],n=(e=o.getCurrentInstance())===null||e===void 0?void 0:e.proxy,s=n??o.getCurrentScope();if(s==null&&!o.hasInjectionContext())throw new Error("injectLocal must be called in setup");return s&&_.has(s)&&i in _.get(s)?_.get(s)[i]:o.inject(...t)},ft=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const pt=Object.prototype.toString,bt=t=>pt.call(t)==="[object Object]";function G(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function D(t){return Array.isArray(t)?t:[t]}function yt(t){return o.getCurrentInstance()}function wt(t,e=!0,i){yt()?o.onMounted(t,i):e?t():o.nextTick(t)}function xt(t,e,i){return o.watch(t,e,{...i,immediate:!0})}const P=ft?window:void 0;function Rt(t){var e;const i=o.toValue(t);return(e=i?.$el)!==null&&e!==void 0?e:i}function L(...t){const e=(n,s,a,h)=>(n.addEventListener(s,a,h),()=>n.removeEventListener(s,a,h)),i=o.computed(()=>{const n=D(o.toValue(t[0])).filter(s=>s!=null);return n.every(s=>typeof s!="string")?n:void 0});return xt(()=>{var n,s;return[(n=(s=i.value)===null||s===void 0?void 0:s.map(a=>Rt(a)))!==null&&n!==void 0?n:[P].filter(a=>a!=null),D(o.toValue(i.value?t[1]:t[0])),D(o.unref(i.value?t[2]:t[1])),o.toValue(i.value?t[3]:t[2])]},([n,s,a,h],c,d)=>{if(!n?.length||!s?.length||!a?.length)return;const l=bt(h)?{...h}:h,m=n.flatMap(u=>s.flatMap(g=>a.map(r=>e(u,g,r,l))));d(()=>{m.forEach(u=>u())})},{flush:"post"})}function zt(){const t=o.shallowRef(!1),e=o.getCurrentInstance();return e&&o.onMounted(()=>{t.value=!0},e),t}function St(t){const e=zt();return o.computed(()=>(e.value,!!t()))}const vt=Symbol("vueuse-ssr-width");function Ct(){const t=o.hasInjectionContext()?gt(vt,null):null;return typeof t=="number"?t:void 0}function Mt(t,e={}){const{window:i=P,ssrWidth:n=Ct()}=e,s=St(()=>i&&"matchMedia"in i&&typeof i.matchMedia=="function"),a=o.shallowRef(typeof n=="number"),h=o.shallowRef(),c=o.shallowRef(!1),d=l=>{c.value=l.matches};return o.watchEffect(()=>{if(a.value){a.value=!s.value,c.value=o.toValue(t).split(",").some(l=>{const m=l.includes("not all"),u=l.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),g=l.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let r=!!(u||g);return u&&r&&(r=n>=G(u[1])),g&&r&&(r=n<=G(g[1])),m?!r:r});return}s.value&&(h.value=i.matchMedia(o.toValue(t)),c.value=h.value.matches)}),L(h,"change",d,{passive:!0}),o.computed(()=>c.value)}function kt(t={}){const{window:e=P,initialWidth:i=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:a=!0,type:h="inner"}=t,c=o.shallowRef(i),d=o.shallowRef(n),l=()=>{if(e)if(h==="outer")c.value=e.outerWidth,d.value=e.outerHeight;else if(h==="visual"&&e.visualViewport){const{width:u,height:g,scale:r}=e.visualViewport;c.value=Math.round(u*r),d.value=Math.round(g*r)}else a?(c.value=e.innerWidth,d.value=e.innerHeight):(c.value=e.document.documentElement.clientWidth,d.value=e.document.documentElement.clientHeight)};l(),wt(l);const m={passive:!0};return L("resize",l,m),e&&h==="visual"&&e.visualViewport&&L(e.visualViewport,"resize",l,m),s&&o.watch(Mt("(orientation: portrait)"),()=>l()),{width:c,height:d}}function Q(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function k(t,e,i,n=1){const[s,a]=typeof n=="number"?[n,n]:n,h=Math.round(e/s/t[0])*t[0],c=Math.round(i/a/t[1])*t[1];return[h,c]}function V(t,e,i){return t-e-i}function $(t,e,i){return t-e-i}function y(t,e,i){return e!==null&&t<e?e:i!==null&&i<t?i:t}function J(t,e,i){let n=t;const s=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].find(a=>Q(n[a]));if(!Q(n[s]))return!1;do{if(n[s](e))return!0;if(n===i)return!1;n=n.parentNode}while(n);return!1}function It(t){const e=window.getComputedStyle(t);return[parseFloat(e.getPropertyValue("width"),10),parseFloat(e.getPropertyValue("height"),10)]}function v(t,e,i){t&&(t.attachEvent?t.attachEvent("on"+e,i):t.addEventListener?t.addEventListener(e,i,!0):t["on"+e]=i)}function x(t,e,i){t&&(t.detachEvent?t.detachEvent("on"+e,i):t.removeEventListener?t.removeEventListener(e,i,!0):t["on"+e]=null)}const Tt=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},N={mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"},touch:{start:"touchstart",move:"touchmove",stop:"touchend"}},Et={userSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none",MsUserSelect:"none"},Lt={userSelect:"auto",MozUserSelect:"auto",WebkitUserSelect:"auto",MsUserSelect:"auto"};let R=N.mouse;const Nt={replace:!0,name:"vue-draggable-resizable",props:{className:{type:String,default:"vdr"},classNameDraggable:{type:String,default:"draggable"},classNameResizable:{type:String,default:"resizable"},classNameDragging:{type:String,default:"dragging"},classNameResizing:{type:String,default:"resizing"},classNameActive:{type:String,default:"active"},classNameHandle:{type:String,default:"handle"},disableUserSelect:{type:Boolean,default:!0},enableNativeDrag:{type:Boolean,default:!1},preventDeactivation:{type:Boolean,default:!1},active:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},lockAspectRatio:{type:Boolean,default:!1},w:{type:[Number,String],default:200,validator:t=>typeof t=="number"?t>0:t==="auto"},h:{type:[Number,String],default:200,validator:t=>typeof t=="number"?t>0:t==="auto"},minWidth:{type:Number,default:0,validator:t=>t>=0},minHeight:{type:Number,default:0,validator:t=>t>=0},maxWidth:{type:Number,default:null,validator:t=>t>=0},maxHeight:{type:Number,default:null,validator:t=>t>=0},x:{type:Number,default:0},y:{type:Number,default:0},z:{type:[String,Number],default:"auto",validator:t=>typeof t=="string"?t==="auto":t>=0},handles:{type:Array,default:()=>["tl","tm","tr","mr","br","bm","bl","ml"],validator:t=>{const e=new Set(["tl","tm","tr","mr","br","bm","bl","ml"]);return new Set(t.filter(i=>e.has(i))).size===t.length}},dragHandle:{type:String,default:null},dragCancel:{type:String,default:null},axis:{type:String,default:"both",validator:t=>["x","y","both"].includes(t)},grid:{type:Array,default:()=>[1,1]},parent:{type:Boolean,default:!1},scale:{type:[Number,Array],default:1,validator:t=>typeof t=="number"?t>0:t.length===2&&t[0]>0&&t[1]>0},onDragStart:{type:Function,default:()=>!0},onDrag:{type:Function,default:()=>!0},onResizeStart:{type:Function,default:()=>!0},onResize:{type:Function,default:()=>!0}},data:function(){return{left:this.x,top:this.y,right:null,bottom:null,width:null,height:null,widthTouched:!1,heightTouched:!1,aspectFactor:null,parentWidth:null,parentHeight:null,handle:null,enabled:this.active,resizing:!1,dragging:!1,dragEnable:!1,resizeEnable:!1,zIndex:this.z}},created:function(){this.maxWidth&&this.minWidth>this.maxWidth&&console.warn("[Vdr warn]: Invalid prop: minWidth cannot be greater than maxWidth"),this.maxHeight&&this.minHeight>this.maxHeight&&console.warn("[Vdr warn]: Invalid prop: minHeight cannot be greater than maxHeight"),this.resetBoundsAndMouseState()},mounted:function(){this.enableNativeDrag||(this.$el.ondragstart=()=>!1);const[t,e]=this.getParentSize();this.parentWidth=t,this.parentHeight=e;const[i,n]=It(this.$el);this.aspectFactor=(this.w!=="auto"?this.w:i)/(this.h!=="auto"?this.h:n),this.width=this.w!=="auto"?this.w:i,this.height=this.h!=="auto"?this.h:n,this.right=this.parentWidth-this.width-this.left,this.bottom=this.parentHeight-this.height-this.top,this.active&&this.$emit("activated"),v(document.documentElement,"mousedown",this.deselect),v(document.documentElement,"touchend touchcancel",this.deselect),v(window,"resize",this.checkParentSize)},beforeUnmount:function(){x(document.documentElement,"mousedown",this.deselect),x(document.documentElement,"touchstart",this.handleUp),x(document.documentElement,"mousemove",this.move),x(document.documentElement,"touchmove",this.move),x(document.documentElement,"mouseup",this.handleUp),x(document.documentElement,"touchend touchcancel",this.deselect),x(window,"resize",this.checkParentSize)},methods:{resetBoundsAndMouseState(){this.mouseClickPosition={mouseX:0,mouseY:0,x:0,y:0,w:0,h:0},this.bounds={minLeft:null,maxLeft:null,minRight:null,maxRight:null,minTop:null,maxTop:null,minBottom:null,maxBottom:null}},checkParentSize(){if(this.parent){const[t,e]=this.getParentSize();this.parentWidth=t,this.parentHeight=e,this.right=this.parentWidth-this.width-this.left,this.bottom=this.parentHeight-this.height-this.top}},getParentSize(){if(this.parent){const t=window.getComputedStyle(this.$el.parentNode,null);return[parseInt(t.getPropertyValue("width"),10),parseInt(t.getPropertyValue("height"),10)]}return[null,null]},elementTouchDown(t){R=N.touch,this.elementDown(t)},elementMouseDown(t){R=N.mouse,this.elementDown(t)},elementDown(t){if(t instanceof MouseEvent&&t.button!==0)return;const e=t.target||t.srcElement;if(this.$el.contains(e)){if(this.onDragStart(t)===!1)return;if(this.dragHandle&&!J(e,this.dragHandle,this.$el)||this.dragCancel&&J(e,this.dragCancel,this.$el)){this.dragging=!1;return}this.enabled||(this.enabled=!0,this.$emit("activated"),this.$emit("update:active",!0)),this.draggable&&(this.dragEnable=!0),this.mouseClickPosition.mouseX=t.touches?t.touches[0].pageX:t.pageX,this.mouseClickPosition.mouseY=t.touches?t.touches[0].pageY:t.pageY,this.mouseClickPosition.left=this.left,this.mouseClickPosition.right=this.right,this.mouseClickPosition.top=this.top,this.mouseClickPosition.bottom=this.bottom,this.parent&&(this.bounds=this.calcDragLimits()),v(document.documentElement,R.move,this.move),v(document.documentElement,R.stop,this.handleUp)}},calcDragLimits(){return{minLeft:this.left%this.grid[0],maxLeft:Math.floor((this.parentWidth-this.width-this.left)/this.grid[0])*this.grid[0]+this.left,minRight:this.right%this.grid[0],maxRight:Math.floor((this.parentWidth-this.width-this.right)/this.grid[0])*this.grid[0]+this.right,minTop:this.top%this.grid[1],maxTop:Math.floor((this.parentHeight-this.height-this.top)/this.grid[1])*this.grid[1]+this.top,minBottom:this.bottom%this.grid[1],maxBottom:Math.floor((this.parentHeight-this.height-this.bottom)/this.grid[1])*this.grid[1]+this.bottom}},deselect(t){const e=t.target||t.srcElement,i=new RegExp(this.className+"-([trmbl]{2})","");!this.$el.contains(e)&&!i.test(e.className)&&(this.enabled&&!this.preventDeactivation&&(this.enabled=!1,this.$emit("deactivated"),this.$emit("update:active",!1)),x(document.documentElement,R.move,this.handleResize)),this.resetBoundsAndMouseState()},handleTouchDown(t,e){R=N.touch,this.handleDown(t,e)},handleDown(t,e){e instanceof MouseEvent&&e.which!==1||this.onResizeStart(t,e)!==!1&&(e.stopPropagation&&e.stopPropagation(),this.lockAspectRatio&&!t.includes("m")?this.handle="m"+t.substring(1):this.handle=t,this.resizeEnable=!0,this.mouseClickPosition.mouseX=e.touches?e.touches[0].pageX:e.pageX,this.mouseClickPosition.mouseY=e.touches?e.touches[0].pageY:e.pageY,this.mouseClickPosition.left=this.left,this.mouseClickPosition.right=this.right,this.mouseClickPosition.top=this.top,this.mouseClickPosition.bottom=this.bottom,this.bounds=this.calcResizeLimits(),v(document.documentElement,R.move,this.handleResize),v(document.documentElement,R.stop,this.handleUp))},calcResizeLimits(){let t=this.minW,e=this.minH,i=this.maxW,n=this.maxH;const s=this.aspectFactor,[a,h]=this.grid,c=this.width,d=this.height,l=this.left,m=this.top,u=this.right,g=this.bottom;this.lockAspectRatio&&(t/e>s?e=t/s:t=s*e,i&&n?(i=Math.min(i,s*n),n=Math.min(n,i/s)):i?n=i/s:n&&(i=s*n)),i=i-i%a,n=n-n%h;const r={minLeft:null,maxLeft:null,minTop:null,maxTop:null,minRight:null,maxRight:null,minBottom:null,maxBottom:null};return this.parent?(r.minLeft=l%a,r.maxLeft=l+Math.floor((c-t)/a)*a,r.minTop=m%h,r.maxTop=m+Math.floor((d-e)/h)*h,r.minRight=u%a,r.maxRight=u+Math.floor((c-t)/a)*a,r.minBottom=g%h,r.maxBottom=g+Math.floor((d-e)/h)*h,i&&(r.minLeft=Math.max(r.minLeft,this.parentWidth-u-i),r.minRight=Math.max(r.minRight,this.parentWidth-l-i)),n&&(r.minTop=Math.max(r.minTop,this.parentHeight-g-n),r.minBottom=Math.max(r.minBottom,this.parentHeight-m-n)),this.lockAspectRatio&&(r.minLeft=Math.max(r.minLeft,l-m*s),r.minTop=Math.max(r.minTop,m-l/s),r.minRight=Math.max(r.minRight,u-g*s),r.minBottom=Math.max(r.minBottom,g-u/s))):(r.minLeft=null,r.maxLeft=l+Math.floor((c-t)/a)*a,r.minTop=null,r.maxTop=m+Math.floor((d-e)/h)*h,r.minRight=null,r.maxRight=u+Math.floor((c-t)/a)*a,r.minBottom=null,r.maxBottom=g+Math.floor((d-e)/h)*h,i&&(r.minLeft=-(u+i),r.minRight=-(l+i)),n&&(r.minTop=-(g+n),r.minBottom=-(m+n)),this.lockAspectRatio&&i&&n&&(r.minLeft=Math.min(r.minLeft,-(u+i)),r.minTop=Math.min(r.minTop,-(n+g)),r.minRight=Math.min(r.minRight,-l-i),r.minBottom=Math.min(r.minBottom,-m-n))),r},move(t){this.resizing?this.handleResize(t):this.dragEnable&&this.handleDrag(t)},handleDrag(t){const e=this.axis,i=this.grid,n=this.bounds,s=this.mouseClickPosition,a=e&&e!=="y"?s.mouseX-(t.touches?t.touches[0].pageX:t.pageX):0,h=e&&e!=="x"?s.mouseY-(t.touches?t.touches[0].pageY:t.pageY):0,[c,d]=k(i,a,h,this.scale),l=y(s.left-c,n.minLeft,n.maxLeft),m=y(s.top-d,n.minTop,n.maxTop);if(this.onDrag(l,m)===!1)return;const u=y(s.right+c,n.minRight,n.maxRight),g=y(s.bottom+d,n.minBottom,n.maxBottom);this.left=l,this.top=m,this.right=u,this.bottom=g,this.$emit("dragging",this.left,this.top),this.dragging=!0},moveHorizontally(t){const[e]=k(this.grid,t,this.top,1),i=y(e,this.bounds.minLeft,this.bounds.maxLeft);this.left=i,this.right=this.parentWidth-this.width-i},moveVertically(t){const[e,i]=k(this.grid,this.left,t,1),n=y(i,this.bounds.minTop,this.bounds.maxTop);this.top=n,this.bottom=this.parentHeight-this.height-n},handleResize(t){let e=this.left,i=this.top,n=this.right,s=this.bottom;const a=this.mouseClickPosition,h=this.aspectFactor,c=a.mouseX-(t.touches?t.touches[0].pageX:t.pageX),d=a.mouseY-(t.touches?t.touches[0].pageY:t.pageY);!this.widthTouched&&c&&(this.widthTouched=!0),!this.heightTouched&&d&&(this.heightTouched=!0);const[l,m]=k(this.grid,c,d,this.scale);this.handle.includes("b")?(s=y(a.bottom+m,this.bounds.minBottom,this.bounds.maxBottom),this.lockAspectRatio&&this.resizingOnY&&(n=this.right-(this.bottom-s)*h)):this.handle.includes("t")&&(i=y(a.top-m,this.bounds.minTop,this.bounds.maxTop),this.lockAspectRatio&&this.resizingOnY&&(e=this.left-(this.top-i)*h)),this.handle.includes("r")?(n=y(a.right+l,this.bounds.minRight,this.bounds.maxRight),this.lockAspectRatio&&this.resizingOnX&&(s=this.bottom-(this.right-n)/h)):this.handle.includes("l")&&(e=y(a.left-l,this.bounds.minLeft,this.bounds.maxLeft),this.lockAspectRatio&&this.resizingOnX&&(i=this.top-(this.left-e)/h));const u=V(this.parentWidth,e,n),g=$(this.parentHeight,i,s);this.onResize(this.handle,e,i,u,g)!==!1&&(this.left=e,this.top=i,this.right=n,this.bottom=s,this.width=u,this.height=g,this.$emit("resizing",this.left,this.top,this.width,this.height),this.resizing=!0)},changeWidth(t){const[e]=k(this.grid,t,0,1),i=y(this.parentWidth-e-this.left,this.bounds.minRight,this.bounds.maxRight);let n=this.bottom;this.lockAspectRatio&&(n=this.bottom-(this.right-i)/this.aspectFactor);const s=V(this.parentWidth,this.left,i),a=$(this.parentHeight,this.top,n);this.right=i,this.bottom=n,this.width=s,this.height=a},changeHeight(t){const[e,i]=k(this.grid,0,t,1),n=y(this.parentHeight-i-this.top,this.bounds.minBottom,this.bounds.maxBottom);let s=this.right;this.lockAspectRatio&&(s=this.right-(this.bottom-n)*this.aspectFactor);const a=V(this.parentWidth,this.left,s),h=$(this.parentHeight,this.top,n);this.right=s,this.bottom=n,this.width=a,this.height=h},handleUp(t){this.handle=null,this.resetBoundsAndMouseState(),this.dragEnable=!1,this.resizeEnable=!1,this.resizing&&(this.resizing=!1,this.$emit("resizeStop",this.left,this.top,this.width,this.height)),this.dragging&&(this.dragging=!1,this.$emit("dragStop",this.left,this.top)),x(document.documentElement,R.move,this.handleResize)}},computed:{style(){return{transform:`translate(${this.left}px, ${this.top}px)`,width:this.computedWidth,height:this.computedHeight,zIndex:this.zIndex,...this.dragging&&this.disableUserSelect?Et:Lt}},actualHandles(){return this.resizable?this.handles:[]},computedWidth(){return this.w==="auto"&&!this.widthTouched?"auto":this.width+"px"},computedHeight(){return this.h==="auto"&&!this.heightTouched?"auto":this.height+"px"},minW(){return this.minWidth},minH(){return this.minHeight},maxW(){return this.maxWidth},maxH(){return this.maxHeight},resizingOnX(){return!!this.handle&&(this.handle.includes("l")||this.handle.includes("r"))},resizingOnY(){return!!this.handle&&(this.handle.includes("t")||this.handle.includes("b"))},isCornerHandle(){return!!this.handle&&["tl","tr","br","bl"].includes(this.handle)}},watch:{active(t){this.enabled=t,t?this.$emit("activated"):this.$emit("deactivated")},z(t){(t>=0||t==="auto")&&(this.zIndex=t)},x(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcDragLimits()),this.moveHorizontally(t))},y(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcDragLimits()),this.moveVertically(t))},lockAspectRatio(t){t?this.aspectFactor=this.width/this.height:this.aspectFactor=void 0},w(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcResizeLimits()),this.changeWidth(t))},h(t){this.resizing||this.dragging||(this.parent&&(this.bounds=this.calcResizeLimits()),this.changeHeight(t))}}},Wt=["onMousedown","onTouchstart"];function Ht(t,e,i,n,s,a){return o.openBlock(),o.createElementBlock("div",{style:o.normalizeStyle(a.style),class:o.normalizeClass([{[i.classNameActive]:t.enabled,[i.classNameDragging]:t.dragging,[i.classNameResizing]:t.resizing,[i.classNameDraggable]:i.draggable,[i.classNameResizable]:i.resizable},i.className]),onMousedown:e[0]||(e[0]=(...h)=>a.elementMouseDown&&a.elementMouseDown(...h)),onTouchstart:e[1]||(e[1]=(...h)=>a.elementTouchDown&&a.elementTouchDown(...h))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.actualHandles,h=>(o.openBlock(),o.createElementBlock("div",{key:h,class:o.normalizeClass([i.classNameHandle,i.classNameHandle+"-"+h]),style:o.normalizeStyle({display:t.enabled?"block":"none"}),onMousedown:o.withModifiers(c=>a.handleDown(h,c),["stop","prevent"]),onTouchstart:o.withModifiers(c=>a.handleTouchDown(h,c),["stop","prevent"])},[o.renderSlot(t.$slots,h)],46,Wt))),128)),o.renderSlot(t.$slots,"default")],38)}const tt=Tt(Nt,[["render",Ht]]);function j(t){j.installed||(j.installed=!0,t.component("VueDraggableResizable",tt))}const Bt={install:j};let W=null;typeof window<"u"?W=window.Vue:typeof global<"u"&&(W=global.Vue),W&&W.use(Bt);const I={duration:3e3,message:"",onClose:void 0,showClose:!1,placement:void 0,zIndex:2e3},Ut={duration:{type:Number,default:I.duration},message:{type:[String,Object,Function],default:I.message},onClose:{type:Function,default:I.onClose},showClose:{type:Boolean,default:I.showClose},zIndex:{type:Number,default:I.zIndex}},et={current:0},it=o.ref(0),_t=2e3,Dt=Symbol("elZIndexContextKey"),Pt=Symbol("zIndexContextKey"),Vt=t=>{const e=o.getCurrentInstance()?o.inject(Dt,et):et,i=o.getCurrentInstance()?o.inject(Pt,void 0):void 0,n=o.computed(()=>o.unref(i)||_t),s=o.computed(()=>n.value+it.value);return{initialZIndex:n,currentZIndex:s,nextZIndex:()=>(e.current++,it.value=e.current,s.value)}},$t={class:"yl-ai-modal"},jt=400,Ft=K(Object.assign({name:"InstanceConstructor"},{__name:"instanceConstructor",props:Ut,emits:["destroy"],setup(t,{expose:e,emit:i}){const n=o.ref(!1),s=t,a=i,h=o.ref(!1),{currentZIndex:c,nextZIndex:d}=Vt();o.ref(0);const l=o.reactive({x:0,y:0,w:.01,height:.01,z:2e3,ironManIndex:0}),m=new URL("./assets/iron-man/01.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,u=new URL("./assets/iron-man/02.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,g=new URL("./assets/iron-man/03.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,r=new URL("./assets/iron-man/04.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,Xt=new URL("./assets/iron-man/05.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href,Zt=new URL("./assets/iron-man/06.gif",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("yl-ai-modal.umd.js",document.baseURI).href).href;let nt=[m,u,g,r,Xt,Zt];const qt=o.computed(()=>({background:`url(${nt[l.ironManIndex]}) no-repeat center`}));setInterval(()=>{l.ironManIndex=Math.floor(Math.random()*nt.length)},5e3);const O=o.useTemplateRef("vueDraggableResizableRef"),A=()=>{O.value&&O.value.checkParentSize()},E=o.useTemplateRef("aiHuman"),ot=()=>{const f=E.value.getBoundingClientRect(),{width:b,height:w}=f,S=jt+b,C=window.innerWidth,M=window.innerHeight,rt=Math.round(M*.8),ee=C-S-16,ie=(M-rt)/2;return{w:S,x:ee,y:ie,height:rt}},{width:st,height:at}=kt({});o.watch([at,st],()=>{if(n.value)Z();else{const{w:f,height:b,x:w,y:z}=l;(f+w>st.value||b+z>at.value)&&ht()}});function Y(){n.value=!1,o.nextTick(()=>{h.value||s.onClose?.()})}const X=o.ref(!1),Kt=f=>{X.value=!0},Gt=(f,b)=>{l.x=f,l.y=b},Qt=()=>{X.value=!1},Z=()=>{if(X.value)return;const f=E.value.getBoundingClientRect(),{width:b,height:w}=f,{w:z,height:S}=ot();let C=l.y;n.value||(C=l.y+w-S,l.y+w<=S&&(C=0)),n.value=!0;let M=l.x;l.x+z>=window.innerWidth&&(M=window.innerWidth-z),Object.assign(l,{x:M,y:C}),A(),o.nextTick(()=>{Object.assign(l,{w:z,height:S}),A()})},Jt=()=>{const f=E.value.getBoundingClientRect(),{width:b,height:w}=f;Object.assign(l,{w:b,height:w,y:l.y+l.height-w})};o.onBeforeMount(()=>{});function ht(){o.nextTick(()=>{const f=E.value.getBoundingClientRect(),{width:b,height:w}=f,{height:z,x:S,y:C}=ot(),M=c.value;Object.assign(l,{w:b,height:w,x:S,y:C+z-w,z:M}),A()})}o.onMounted(()=>{d(),ht()});function te(f){(f.keyCode===27||f.key==="Escape")&&Y()}return L(document,"keydown",te),e({show:Z,close:Y,destroy:()=>{a("destroy")}}),(f,b)=>(o.openBlock(),o.createBlock(o.unref(tt),{class:"dialog-vdr",ref_key:"vueDraggableResizableRef",ref:O,onDrag:Kt,onDragStop:Gt,onClick:Qt,x:l.x,y:l.y,z:l.z,w:l.w,h:l.height,parent:!0,resizable:!1,"drag-handle":".yl-ai-human"},{default:o.withCtx(()=>[o.createElementVNode("div",{ref_key:"aiHuman",ref:E,class:"yl-ai-human ai-human",style:o.normalizeStyle(qt.value),onClick:Z},null,4),o.createVNode(o.Transition,{name:"fade",onBeforeEnter:b[0]||(b[0]=w=>h.value=!0),onBeforeLeave:f.onClose,onAfterLeave:Jt},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",$t,[o.renderSlot(f.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(f.message),1)],!0)],512),[[o.vShow,n.value]])]),_:3},8,["onBeforeLeave"]),n.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"icon-close",onClick:Y})):o.createCommentVNode("",!0)]),_:3},8,["x","y","z","w","h"]))}}),[["__scopeId","data-v-acb02c82"]]);let H=null;const Ot=t=>{let e;return!t||mt(t)||o.isVNode(t)||U(t)?e={message:t}:e=t,{...I,...e}},At=t=>{const{handler:e}=t;e.close()},Yt=({appendTo:t=document.body,...e},i)=>{const n=e.onClose,s=document.createElement("div"),a={...e,onClose:()=>{n?.(),At(l)},onDestroy:()=>{H=null,o.render(null,s)}},h=o.createVNode(Ft,a,U(a.message)||o.isVNode(a.message)?{default:U(a.message)?a.message:()=>a.message}:null);h.appContext=i||F._context,o.render(h,s),t.appendChild(s.firstElementChild);const c=h.component,l={vnode:h,vm:c,handler:{close:()=>{c.exposed?.close()},destroy:()=>{c.exposed?.destroy()},open:()=>{c.exposed?.show()}},props:h.component.props};return l},F=(t={},e)=>{if(H)return H.handler;const i=Ot(t),n=Yt(i,e);return H=n,n.handler};return F._context=null,(t={})=>F({message:o.h(ut,t)})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yl-ai-modal",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --open",