PageSourceSearch

https://www.ftu.org.hk/_nuxt/KYqwKzdr.js

js ftu.org.hk collected 2026-09-25 04:50:06 UTC 7,304 bytes, 1 lines download raw bytes

1import{bd as R,be as S,bf as fe,bg as G,d as J,bh as _,bi as $,bj as L,i as E,bk as ve,c as p,bl as le,bm as ae,bn as be,bo as ce,p as f,bp as ie,bq as W,br as se,bs as B,bt as he,bu as ge,S as j,bv as Oe,bw as X,aL as Te,bx as pe,by as ye,Q as Z,bz as q}from"./D1FcBL9p.js";const[ke,T,ee]=R("picker"),ue=e=>e.find(l=>!l.disabled)||e[0];function xe(e,l){const o=e[0];if(o){if(Array.isArray(o))return"multiple";if(l.children in o)return"cascade"}return"default"}function V(e,l){l=G(l,0,e.length);for(let o=l;o<e.length;o++)if(!e[o].disabled)return o;for(let o=l-1;o>=0;o--)if(!e[o].disabled)return o;return 0}const te=(e,l,o)=>l!==void 0&&e.some(u=>u[o.value]===l);function Q(e,l,o){const u=e.findIndex(v=>v[o.value]===l),c=V(e,u);return e[c]}function Ce(e,l,o){const u=[];let c={[l.children]:e},v=0;for(;c&&c[l.children];){const b=c[l.children],h=o.value[v];if(c=fe(h)?Q(b,h,l):void 0,!c&&b.length){const r=ue(b)[l.value];c=Q(b,r,l)}v++,u.push(b)}return u}function Ee(e){const{transform:l}=window.getComputedStyle(e),o=l.slice(7,l.length-1).split(", ")[5];return Number(o)}function Se(e){return S({text:"text",value:"value",children:"children"},e)}const ne=200,oe=300,we=15,[re,z]=R("picker-column"),de=Symbol(re);var Pe=J({name:re,props:{value:L,fields:_(Object),options:$(),readonly:Boolean,allowHtml:Boolean,optionHeight:_(Number),swipeDuration:_(L),visibleOptionNum:_(L)},emits:["change","clickOption","scrollInto"],setup(e,{emit:l,slots:o}){let u,c,v,b,h;const r=E(),g=E(),d=E(0),m=E(0),y=ve(),x=()=>e.options.length,H=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,k=a=>{let s=V(e.options,a);const t=-s*e.optionHeight,n=()=>{s>x()-1&&(s=V(e.options,a));const i=e.options[s][e.fields.value];i!==e.value&&l("change",i)};u&&t!==d.value?h=n:n(),d.value=t},O=()=>e.readonly||!e.options.length,F=a=>{u||O()||(h=null,m.value=ne,k(a),l("clickOption",e.options[a]))},C=a=>G(Math.round(-a/e.optionHeight),0,x()-1),M=p(()=>C(d.value)),K=(a,s)=>{const t=Math.abs(a/s);a=d.value+t/.003*(a<0?-1:1);const n=C(a);m.value=+e.swipeDuration,k(n)},w=()=>{u=!1,m.value=0,h&&(h(),h=null)},U=a=>{if(!O()){if(y.start(a),u){const s=Ee(g.value);d.value=Math.min(0,s-H())}m.value=0,c=d.value,v=Date.now(),b=c,h=null}},Y=a=>{if(O())return;y.move(a),y.isVertical()&&(u=!0,ie(a,!0));const s=G(c+y.deltaY.value,-(x()*e.optionHeight),e.optionHeight),t=C(s);t!==M.value&&l("scrollInto",e.options[t]),d.value=s;const n=Date.now();n-v>oe&&(v=n,b=s)},P=()=>{if(O())return;const a=d.value-b,s=Date.now()-v;if(s<oe&&Math.abs(a)>we){K(a,s);return}const n=C(d.value);m.value=ne,k(n),setTimeout(()=>{u=!1},0)},D=()=>{const a={height:`${e.optionHeight}px`};return e.options.map((s,t)=>{const n=s[e.fields.text],{disabled:i}=s,N=s[e.fields.value],I={role:"button",style:a,tabindex:i?-1:0,class:[z("item",{disabled:i,selected:N===e.value}),s.className],onClick:()=>F(t)},me={class:"van-ellipsis",[e.allowHtml?"innerHTML":"textContent"]:n};return f("li",I,[o.option?o.option(s,t):f("div",me,null)])})};return le(de),ae({stopMomentum:w}),be(()=>{const a=u?Math.floor(-d.value/e.optionHeight):e.options.findIndex(n=>n[e.fields.value]===e.value),s=V(e.options,a),t=-s*e.optionHeight;u&&s<a&&w(),d.value=t}),ce("touchmove",Y,{target:r}),()=>f("div",{ref:r,class:z(),onTouchstartPassive:U,onTouchend:P,onTouchcancel:P},[f("ul",{ref:g,style:{transform:`translate3d(0, ${d.value+H()}px, 0)`,transitionDuration:`${m.value}ms`,transitionProperty:m.value?"all":"none"},class:z("wrapper"),onTransitionend:w},[D()])])}});const[Ie]=R("picker-toolbar"),A={title:String,cancelButtonText:String,confirmButtonText:String},He=["cancel","confirm","title","toolbar"],Me=Object.keys(A);var De=J({name:Ie,props:A,emits:["confirm","cancel"],setup(e,{emit:l,slots:o}){const u=()=>{if(o.title)return o.title();if(e.title)return f("div",{class:[T("title"),"van-ellipsis"]},[e.title])},c=()=>l("cancel"),v=()=>l("confirm"),b=()=>{var r;const g=(r=e.cancelButtonText)!=null?r:ee("cancel");if(!(!o.cancel&&!g))return f("button",{type:"button",class:[T("cancel"),W],onClick:c},[o.cancel?o.cancel():g])},h=()=>{var r;const g=(r=e.confirmButtonText)!=null?r:ee("confirm");if(!(!o.confirm&&!g))return f("button",{type:"button",class:[T("confirm"),W],onClick:v},[o.confirm?o.confirm():g])};return()=>f("div",{class:T("toolbar")},[o.toolbar?o.toolbar():[b(),u(),h()]])}});const[Ne]=R("picker-group"),_e=Symbol(Ne);S({tabs:$(),activeTab:B(0),nextStepText:String,showToolbar:se},A);const Be=S({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:B(44),showToolbar:se,swipeDuration:B(1e3),visibleOptionNum:B(6)},A),Ve=S({},Be,{columns:$(),modelValue:$(),toolbarPosition:pe("top"),columnsFieldNames:Object});var Re=J({name:ke,props:Ve,emits:["confirm","cancel","change","scrollInto","clickOption","update:modelValue"],setup(e,{emit:l,slots:o}){const u=E(),c=E(e.modelValue.slice(0)),{parent:v}=le(_e),{children:b,linkChildren:h}=he(de);h();const r=p(()=>Se(e.columnsFieldNames)),g=p(()=>ge(e.optionHeight)),d=p(()=>xe(e.columns,r.value)),m=p(()=>{const{columns:t}=e;switch(d.value){case"multiple":return t;case"cascade":return Ce(t,r.value,c);default:return[t]}}),y=p(()=>m.value.some(t=>t.length)),x=p(()=>m.value.map((t,n)=>Q(t,c.value[n],r.value))),H=p(()=>m.value.map((t,n)=>t.findIndex(i=>i[r.value.value]===c.value[n]))),k=(t,n)=>{if(c.value[t]!==n){const i=c.value.slice(0);i[t]=n,c.value=i}},O=()=>({selectedValues:c.value.slice(0),selectedOptions:x.value,selectedIndexes:H.value}),F=(t,n)=>{k(n,t),d.value==="cascade"&&c.value.forEach((i,N)=>{const I=m.value[N];
1te(I,i,r.value)||k(N,I.length?I[0][r.value.value]:void 0)}),Z(()=>{l("change",S({columnIndex:n},O()))})},C=(t,n)=>{const i={columnIndex:n,currentOption:t};l("clickOption",S(O(),i)),l("scrollInto",i)},M=()=>{b.forEach(n=>n.stopMomentum());const t=O();return Z(()=>{const n=O();l("confirm",n)}),t},K=()=>l("cancel",O()),w=()=>m.value.map((t,n)=>f(Pe,{value:c.value[n],fields:r.value,options:t,readonly:e.readonly,allowHtml:e.allowHtml,optionHeight:g.value,swipeDuration:e.swipeDuration,visibleOptionNum:e.visibleOptionNum,onChange:i=>F(i,n),onClickOption:i=>C(i,n),onScrollInto:i=>{l("scrollInto",{currentOption:i,columnIndex:n})}},{option:o.option})),U=t=>{if(y.value){const n={height:`${g.value}px`},i={backgroundSize:`100% ${(t-g.value)/2}px`};return[f("div",{class:T("mask"),style:i},null),f("div",{class:[ye,T("frame")],style:n},null)]}},Y=()=>{const t=g.value*+e.visibleOptionNum,n={height:`${t}px`};return!e.loading&&!y.value&&o.empty?o.empty():f("div",{ref:u,class:T("columns"),style:n},[w(),U(t)])},P=()=>{if(e.showToolbar&&!v)return f(De,Te(X(e,Me),{onConfirm:M,onCancel:K}),X(o,He))},D=t=>{t.forEach((n,i)=>{n.length&&!te(n,c.value[i],r.value)&&k(i,ue(n)[r.value.value])})};j(m,t=>D(t),{immediate:!0});let a;return j(()=>e.modelValue,t=>{!q(t,c.value)&&!q(t,a)&&(c.value=t.slice(0),a=t.slice(0)),e.modelValue.length===0&&D(m.value)},{deep:!0}),j(c,t=>{q(t,e.modelValue)||(a=t.slice(0),l("update:modelValue",a))},{immediate:!0}),ce("touchmove",ie,{target:u}),ae({confirm:M,getSelectedOptions:()=>x.value}),()=>{var t,n;return f("div",{class:T()},[e.toolbarPosition==="top"?P():null,e.loading?f(Oe,{class:T("loading")},null):null,(t=o["columns-top"])==null?void 0:t.call(o),Y(),(n=o["columns-bottom"])==null?void 0:n.call(o),e.toolbarPosition==="bottom"?P():null])}}});export{Be as p,Re as s};

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.