youtuber-blog-frontend/build/client/_app/immutable/chunks/textarea.OR1yZTo2.js

4 lines
118 KiB
JavaScript
Raw Normal View History

2024-06-21 23:07:29 +00:00
import{s as ve,F as Ze,k as ie,i as Y,E as G,o as $,y as Z,z as Fe,I as Nt,c as xe,e as Ye,d as Ke,f as ot,D as se,v as qn,w as V,u as Oe,g as Ne,a as Ie,x as vn,ad as Wn,ab as Hn,n as Ae,b as Cs,j as xs,ak as ln,S as z,al as jr,A as rn,C as Zr,t as Pr,h as Dr,l as Vr,am as Lr,p as ar,ai as Os,aa as on,K as In,O as Rt}from"./scheduler.BsMbz5U8.js";import{g as be,a as At}from"./spread.CgU5AtxT.js";import{S as ke,i as we,g as Vt,a as q,e as Lt,t as F,c as ft,b as ht,m as mt,d as pt,k as Ns}from"./index.rkWRBFIu.js";import{c as oe}from"./button.Ba55pzkL.js";import{m as Mn,d as Rn,o as Is,l as En,a as Ms,k as ir,s as Rs,c as js}from"./index.BBc34iid.js";import{t as Zs,o as Ps,c as Fr,a as Br,r as Ds,g as Vs}from"./Toaster.svelte_svelte_type_style_lang.DiP1zXXX.js";import{e as un}from"./each.jOEBnCSj.js";import{w as X,d as Yn,a as Sn}from"./index.DwF-TCr7.js";import{p as jt,n as or}from"./stores.Dq-jxEEw.js";import{b as Ls,g as Fs,i as Bs,a as An}from"./entry.iekzDyP5.js";import{e as Us}from"./forms.CYRa2lUv.js";const zs=!0,Ur=zs;function qs(){return{elements:{root:Mn("label",{action:e=>({destroy:Rn(e,"mousedown",r=>{!r.defaultPrevented&&r.detail>1&&r.preventDefault()})})})}}}const Ws={defaultChecked:!1,disabled:!1,required:!1,name:"",value:""},{name:lr}=js("switch");function Hs(t){const e={...Ws,...t},n=Zs(Is(e,"checked")),{disabled:r,required:s,name:a,value:i}=n,o=e.checked??X(e.defaultChecked),l=Ps(o,e==null?void 0:e.onCheckedChange);function u(){r.get()||l.update(T=>!T)}const d=Mn(lr(),{stores:[l,r,s],returned:([T,S,b])=>({"data-disabled":En(S),disabled:En(S),"data-state":T?"checked":"unchecked",type:"button",role:"switch","aria-checked":T?"true":"false","aria-required":b?"true":void 0}),action(T){return{destroy:Ms(Rn(T,"click",()=>{u()}),Rn(T,"keydown",b=>{b.key!==ir.ENTER&&b.key!==ir.SPACE||(b.preventDefault(),u())}))}}}),h=Mn(lr("input"),{stores:[l,a,s,r,i],returned:([T,S,b,L,g])=>({type:"checkbox","aria-hidden":!0,hidden:!0,tabindex:-1,name:S,value:g,checked:T,required:b,disabled:En(L),style:Rs({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"})})});return{elements:{root:d,input:h},states:{checked:l},options:n}}function Ys(){const t="label",n=Fr(t,["root"]);return{NAME:t,getAttrs:n}}const Ks=t=>({builder:t&4}),ur=t=>({builder:t[2]}),Gs=t=>({builder:t&4}),cr=t=>({builder:t[2]});function Js(t){let e,n,r,s;const a=t[8].default,i=xe(a,t,t[7],ur);let o=[t[2],t[5]],l={};for(let u=0;u<o.length;u+=1)l=Z(l,o[u]);return{c(){e=Ye("label"),i&&i.c(),this.h()},l(u){e=Ke(u,"LABEL",{});var d=ot(e);i&&i.l(d),d.forEach(Y),this.h()},h(){se(e,l)},m(u,d){ie(u,e,d),i&&i.m(e,null),t[9](e),n=!0,r||(s=[qn(t[2].action(e)),V(e,"m-mousedown",t[4])],r=!0)},p(u,d){i&&i.p&&(!n||d&132)&&Oe(i,a,u,u[7],n?Ie(a,u[7],d,Ks):Ne(u[7]),ur),se(e,l=be(o,[d&4&&u[2],d&32&&u[5]]))},i(u){n||(F(i,u),n=!0)},o(u){q(i,u),n=!1},d(u){u&&Y(e),i&&i.d(u),t[9](null),r=!1,vn(s)}}}function Xs(t){let e;const n=t[8].default,r=xe(n,t,t[7],cr);return{c(){r&&r.c()},l(s){r&&r.l(s)},m(s,a){r&&r.m(s,a),e=!0},p(s,a){r&&r.p&&(!e||a&132)&&Oe(r,n,s,s[7],e?Ie(n,s[7],a,Gs):Ne(s[7]),cr)},i(s){e||(F(r,s),e=!0)},o(s){q(r,s),e=!1},d(s){r&&r.d(s)}}}function Qs(t){let e,n,r,s;const a=[Xs,Js],i=[];function o(l,u){return l[1]?0:1}return e=o(t),n=i[e]=a[e](t),{c(){n.c(),r=Ze()},l(l){n.l(l),r=Ze()},m(l,u){i[e].m(l,u),ie(l,r,u),s=!0},p(l,[u]){let d=e;e=o(l),e===d?i[e].p(l,u):(Vt(),q(i[d],1,1,()=>{i[d]=null}),Lt(),n=i[e],n?n.p(l,u):(n=i[e]=a[e](l),n.c()),F(n,1),n.m(r.parentNode,r))},i(l){s||(F(n),s=!0)},o(l){q(n),s=!1},d(l){l&&Y(r),i[e].d(l)}}}function $s(t,e,n){let r;const s=["asChild","el"];let a=G(e,s),i,{$$slots:o={},$$scope:l}=e,{asChild:u=!1}=e,{el:d=void 0}=e;const{elements:{root:h}}=qs();$(t,h,g=>n(6,i=g));const T=Br(),{getAttrs:S}=Ys(),b=S("root");function L(g){Nt[g?"unshift":"push"](()=>{d=g,n(0,d)})}return t.$$set=g=>{e=Z(Z({},e),Fe(g)),n(5,a=G(e,s)),"asChild"in g&&n(1,u=g.asChild),"el"in g&&n(0,d=g.el),"$$scope"in g&&n(7,l=g.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=i),t.$$.dirty&4&&Object.assign(r,b)},[d,u,r,h,T,a,i,l,o,L]}let ea=class ex
`):"";t.setCustomValidity(n),n&&t.reportValidity()}const yi=(t,e=0)=>{const n=t.getBoundingClientRect();return n.top>=e&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},vi=(t,e=1.125,n="smooth")=>{const a=t.getBoundingClientRect().top+window.pageYOffset-window.innerHeight/(2*e);window.scrollTo({left:0,top:a,behavior:n})},bi=["checkbox","radio","range","file"];function Nr(t){const e=!!t&&(t instanceof HTMLSelectElement||t instanceof HTMLInputElement&&bi.includes(t.type)),n=!!t&&t instanceof HTMLSelectElement&&t.multiple,r=!!t&&t instanceof HTMLInputElement&&t.type=="file";return{immediate:e,multiple:n,file:r}}var de;(function(t){t[t.Idle=0]="Idle",t[t.Submitting=1]="Submitting",t[t.Delayed=2]="Delayed",t[t.Timeout=3]="Timeout"})(de||(de={}));const ki=new Set;function wi(t,e,n){let r=de.Idle,s,a;const i=ki;function o(){l(),d(r!=de.Delayed?de.Submitting:de.Delayed),s=window.setTimeout(()=>{s&&r==de.Submitting&&d(de.Delayed)},n.delayMs),a=window.setTimeout(()=>{a&&r==de.Delayed&&d(de.Timeout)},n.timeoutMs),i.add(l)}function l(){clearTimeout(s),clearTimeout(a),s=a=0,i.delete(l),d(de.Idle)}function u(){i.forEach(g=>g()),i.clear()}function d(g){r=g,e.submitting.set(r>=de.Submitting),e.delayed.set(r>=de.Delayed),e.timeout.set(r>=de.Timeout)}const h=t;function T(g){const B=g.target;n.selectErrorText&&B.select()}function S(){n.selectErrorText&&h.querySelectorAll("input").forEach(g=>{g.addEventListener("invalid",T)})}function b(){n.selectErrorText&&h.querySelectorAll("input").forEach(g=>g.removeEventListener("invalid",T))}const L=t;{S();const g=B=>{B.clearAll?u():l(),B.cancelled||setTimeout(()=>Vn(L,n),1)};return on(()=>{b(),g({cancelled:!0})}),{submitting(){o()},completed:g,scrollToFirstError(){setTimeout(()=>Vn(L,n),1)},isSubmitting:()=>r===de.Submitting||r===de.Delayed}}}const Vn=async(t,e)=>{if(e.scrollToError=="off")return;const n=e.errorSelector;if(!n)return;await In();let r;if(r=t.querySelector(n),!r)return;r=r.querySelector(n)??r;const s=e.stickyNavbar?document.querySelector(e.stickyNavbar):null;typeof e.scrollToError!="string"?r.scrollIntoView(e.scrollToError):yi(r,(s==null?void 0:s.offsetHeight)??0)||vi(r,void 0,e.scrollToError);function a(o){return typeof e.autoFocusOnError=="boolean"?e.autoFocusOnError:!/iPhone|iPad|iPod|Android/i.test(o)}if(!a(navigator.userAgent))return;let i;if(i=r,["INPUT","SELECT","BUTTON","TEXTAREA"].includes(i.tagName)||(i=i.querySelector('input:not([type="hidden"]):not(.flatpickr-input), select, textarea')),i)try{i.focus({preventScroll:!0}),e.selectErrorText&&i.tagName=="INPUT"&&i.select()}catch{}};class xn extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}}function Ir(t){return Object(t)!==t}const Ti=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ei(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Ti}function Si(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ai(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function wt(t){let e="",n=0;const r=t.length;for(let s=0;s<r;s+=1){const a=t[s],i=Ai(a);i&&(e+=t.slice(n,s)+i,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Qr=-1,Ci=-2,xi=-3,Oi=-4,Ni=-5,$r=-6;function Ii(t,e){const n=[],r=new Map,s=[];for(const u in e)s.push({key:u,fn:e[u]});const a=[];let i=0;function o(u){if(typeof u=="function")throw new xn("Cannot stringify a function",a);if(r.has(u))return r.get(u);if(u===void 0)return Qr;if(Number.isNaN(u))return xi;if(u===1/0)return Oi;if(u===-1/0)return Ni;if(u===0&&1/u<0)return $r;const d=i++;r.set(u,d);for(const{key:T,fn:S}of s){const b=S(u);if(b)return n[d]=`["${T}",${o(b)}]`,d}let h="";if(Ir(u))h=On(u);else switch(Si(u)){case"Number":case"String":case"Boolean":h=`["Object",${On(u)}]`;break;case"BigInt":h=`["BigInt",${u}]`;break;case"Date":h=`["Date","${!isNaN(u.getDate())?u.toISOString():""}"]`;break;case"RegExp":const{source:b,flags:L}=u;h=L?`["RegExp",${wt(b)},"${L}"]`:`["RegExp",${wt(b)}]`;break;case"Array":h="[";for(let g=0;g<u.length;g+=1)g>0&&(h+=","),g in u?(a.push(`[${g}]`),h+=o(u[g]),a.pop()):h+=Ci;h+="]";break;case"Set":h='["Set"';for(const g of u)h+=`,${o(g)}`;h+="]";break;case"Map":h='["Map"';for(const[g,B]of u)a.push(`.get(${Ir(g)?On(g):"..."})`),h+=`,${o(g)},${o(B)}`,a.pop();h+="]";break;default:if(!Ei(u))throw new xn("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(u).length>0)throw new xn("Cannot stringify POJOs with symbolic keys",a);if(Object.getPrototypeOf(u)===null){h='["null"';for(const g in u)a.push(`.${g}`),h+=`,${wt(g)},${o(u[g])}`,a.pop();h+="]"}else{h="{";let g=!1;for(const B in u)g&&(h+=","),g=!0,a.push(`.${B}`),h+=`${wt(B)}:${o(u[B])}`,a.pop();h+="}"}}return n[d]=h,d}const l=o(t);return l<0?`${l}`:`[${n.join(",")}]`}function On(t){const e=typeof t;return e==="string"?wt(t):t instanceof String?wt(t.toString()):t===void 0?Qr.toString():t===0&&1/t<0?$r.toString():e==="bigint"?`["BigInt","${t}"]`:String(t)}function cn(t,e,n){const r=qe(t,e,({parent:s,key:a,value:i})=>(i===void 0&&(s[a]=/\D/.test(a)?{}:[]),s[a]));if(r){const s=n(r.value);r.parent[r.key]=s}return t}function Mi(t,e,n){const r=t.form,s=Et(e),a=Yn(r,i=>{const o=qe(i,s);return o==null?void 0:o.value});return{subscribe(...i){const o=a.subscribe(...i);return()=>o()},update(i,o){r.update(l=>cn(l,s,i),o??n)},set(i,o){r.update(l=>cn(l,s,()=>i),o??n)}}}function Ri(t,e){const n="form"in t;if(!n&&(e==null?void 0:e.taint)!==void 0)throw new ae("If options.taint is set, the whole superForm object must be used as a proxy.");return n}function sn(t,e,n){const r=Et(e);if(Ri(t,n))return Mi(t,e,n);const s=Yn(t,a=>{const i=qe(a,r);return i==null?void 0:i.value});return{subscribe(...a){const i=s.subscribe(...a);return()=>i()},update(a){t.update(i=>cn(i,r,a))},set(a){t.update(i=>cn(i,r,()=>a))}}}function Ln(t){let e={};const n=Array.isArray(t);for(const[r,s]of Object.entries(t))!s||typeof s!="object"||(n?e={...e,...Ln(s)}:e[r]=Ln(s));return e}const an=new WeakMap,yt=new WeakMap,es=t=>{console.warn("Unhandled error caught by Superforms, use onError event to handle it:",t.result.error)},ji={applyAction:!0,invalidateAll:!0,resetForm:!0,autoFocusOnError:"detect",scrollToError:"smooth",errorSelector:'[aria-invalid="true"],[data-invalid]',selectErrorText:!1,stickyNavbar:void 0,taintedMessage:!1,onSubmit:void 0,onResult:void 0,onUpdate:void 0,onUpdated:void 0,onError:es,dataType:"form",validators:void 0,customValidity:!1,clearOnSubmit:"message",delayMs:500,timeoutMs:8e3,multipleSubmits:"prevent",SPA:void 0,validationMethod:"auto"};function Zi(t){return`Duplicate form id's found: "${t}". Multiple forms will receive the same data. Use the id option to differentiate between them, or if this is intended, set the warnings.duplicateId option to false in superForm to disable this warning. More information: https://superforms.rocks/concepts/multiple-forms`}let ts=!1;try