PageSourceSearch

https://www.iqinghu.com/workbench/assets/ChatPinnedWrapper.vue_vue_type_style_index_0_lang-B8YaMbuh.js

js iqinghu.com collected 2026-10-01 15:51:36 UTC 3,700 bytes, 1 lines download raw bytes

1import{d as F,k as a,g as N,G as b,H as d,x as I,e as T,o as W,a as L,N as $,n as j,aq as V}from"./vendor-DYo3sCLj.js";const G=F({__name:"ChatPinnedWrapper",props:{isPinned:{type:Boolean,default:!1},isExpand:{type:Boolean,default:!1},scrollRootSelector:{type:String,default:".qinghu-link-pix-content"},bottomOffset:{type:Number,default:16},pinnedClass:{type:String,default:"pinned"},checkFullyOut:{type:Boolean,default:!0},showPlaceholder:{type:Boolean,default:!0},containerClass:{type:[String,Object,Array],default:""},containerStyle:{type:[String,Object,Array],default:()=>({})},visibilityMargin:{type:Number,default:0},alwaysPinned:{type:Boolean,default:!1}},emits:["update:isPinned","update:isExpand","pinned-dims"],setup(R,{expose:M,emit:_}){const t=R,r=_,k=a(null),O=a(null),E=a(null),l=a(t.alwaysPinned?!0:!!t.isPinned),i=a(!!t.isExpand),x=a(0),s=a(null),f=a(null);let u=null,S=null,c=null,p=null;N(()=>{const e={};return s.value&&(e.width=`${s.value}px`),t.bottomOffset!==void 0&&(e.bottom=`${t.bottomOffset}px`),e}),b(()=>t.isPinned,e=>{l.value=!!e}),b(()=>t.isExpand,e=>{i.value=!!e}),b(l,e=>{r("update:isPinned",e)}),b(i,e=>{r("update:isExpand",e)}),b(()=>t.alwaysPinned,e=>{e?(l.value=!0,d(()=>h())):(l.value=!!t.isPinned,d(()=>v()))});function h(){d(()=>{var C;const e=E.value||k.value;if(!e)return;let n=null;try{n=((C=e.querySelector)==null?void 0:C.call(e,".chat-container"))||e.firstElementChild||e}catch{n=e.firstElementChild||e}if(!n)return;const m=o=>{const g=o.getBoundingClientRect();return{width:g.width||0,height:g.height||0}};let{width:y,height:w}=m(n);if(!w||!y){setTimeout(()=>{const o=m(n);s.value=Math.ceil(o.width||0)||s.value,x.value=Math.ceil(o.height||0)||x.value,f.value=Math.ceil(o.height||0)||f.value,r("pinned-dims",{width:s.value,height:f.value})},60);return}x.value=Math.ceil(w),s.value=Math.ceil(y),f.value=Math.ceil(w),r("pinned-dims",{width:s.value,height:f.value})})}function q(e,n){return t.checkFullyOut,e.bottom<=n.top||e.top>=n.bottom}function v(){if(t.alwaysPinned)return;const e=k.value;if(!e)return;const n=e.getBoundingClientRect(),m=t.scrollRootSelector?document.querySelector(t.scrollRootSelector):null,y=m?m.getBoundingClientRect():{top:0,bottom:window.innerHeight},w=t.visibilityMargin||0,C=t.visibilityMargin||0,o={top:y.top+w,bottom:y.bottom-C},g=q(n,o);if(g&&!l.value)h(),l.value=!0,i.value=!1,d(()=>{});else if(!g&&l.value){h(),l.value=!1,i.value=!1;const P=E.value;P&&(P.style.width="",P.style.bottom=""),d(()=>{})}}function H(){u==null&&(u=requestAnimationFrame(()=>{u=null,v()}))}function z(){d(()=>{const e=t.scrollRootSelector?document.querySelector(t.scrollRootSelector):null;S=e||window,c=H,e?e.addEventListener("scroll",c,{passive:!0}):window.addEventListener("scroll",c,{passive:!0}),p=()=>{h(),v()},window.addEventListener("resize",p),h(),v()})}function A(e){l.value&&!i.value&&(i.value=!0)}function B(){try{c&&S&&(S instanceof Window?window.removeEventListener("scroll",c):S.removeEventListener("scroll",c))}catch{}if(p){try{window.removeEventListener("resize",p)}catch{}p=null}u!=null&&(cancelAnimationFrame(u),u=null);const e=E.value;e&&(e.classList.remove(t.pinnedClass),e.style.width="",e.style.bottom=""),l.value=!1,i.value=!1,r("update:isPinned",!1),r("update:isExpand",!1)}return M({destroy:B,forceCheck:v,isPinned:l,isExpand:i}),z(),I(()=>{B()}),(e,n)=>(W(),T("div",{ref_key:"wrapperRef",ref:k,class:"chat-container-wrapper"},[L("div",{ref_key:"sentinelRef",ref:O,style:{width:"1px",height:"1px",visibility:"hidden","pointer-events":"none"}},null,512),L("div",{style:j({"min-height":x.value-R.visibilityMargin+"px"}),ref_key:"containerRef",ref:E,onClick:$(A,["stop"])},[V(e.$slots,"default")],4)],512))}});export{G as _};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.