@cas-smartdesign/splitter 0.1.0

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.
@@ -0,0 +1,24 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
7
+ <title>Splitter demo</title>
8
+ <style>
9
+ .markdown-body {
10
+ box-sizing: border-box;
11
+ min-width: 200px;
12
+ max-width: 980px;
13
+ margin: 0 auto !important;
14
+ padding-bottom: 45px;
15
+ }
16
+ </style>
17
+ <script type="module" crossorigin src="./doc.mjs"></script>
18
+ <link rel="stylesheet" crossorigin href="./doc.css">
19
+ </head>
20
+
21
+ <body>
22
+ <div class="markdown-body"><div id="markdown-container"></div></div>
23
+ </body>
24
+ </html>
@@ -0,0 +1,164 @@
1
+ var window;(window||={})["@cas-smartdesign/splitter"]=(()=>{var J=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames;var jt=Object.prototype.hasOwnProperty;var zt=(r,t)=>{for(var e in t)J(r,e,{get:t[e],enumerable:!0})},It=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ht(t))!jt.call(r,i)&&i!==e&&J(r,i,{get:()=>t[i],enumerable:!(s=Nt(t,i))||s.enumerable});return r};var Wt=r=>It(J({},"__esModule",{value:!0}),r);var te={};zt(te,{Splitter:()=>v,SplitterResizedEvent:()=>F});var H=window,j=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z=Symbol(),_t=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(j&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(e,t))}return t}toString(){return this.cssText}},z=r=>new M(typeof r=="string"?r:r+"",void 0,Z),Y=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new M(e,r,Z)},G=(r,t)=>{j?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),i=H.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)})},I=j?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return z(e)})(r):r;var Q,W=window,ft=W.trustedTypes,Bt=ft?ft.emptyScript:"",gt=W.reactiveElementPolyfillSupport,et={toAttribute(r,t){switch(t){case Boolean:r=r?Bt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},mt=(r,t)=>t!==r&&(t==t||r==r),tt={attribute:!0,type:String,converter:et,reflect:!1,hasChanged:mt},st="finalized",m=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i))}),t}static createProperty(t,e=tt){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||tt}static finalize(){if(this.hasOwnProperty(st))return!1;this[st]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(I(i))}else t!==void 0&&e.push(I(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return G(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=tt){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let n=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:et).toAttribute(e,s.type);this._$El=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let n=i.getPropertyOptions(o),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((s=n.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?n.converter:et;this._$El=o,this[o]=h.fromAttribute(e,n.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||mt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return(o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(s)):this._$Ek()}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return(i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};m[st]=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},gt?.({ReactiveElement:m}),((Q=W.reactiveElementVersions)!==null&&Q!==void 0?Q:W.reactiveElementVersions=[]).push("1.6.3");var it,B=window,C=B.trustedTypes,yt=C?C.createPolicy("lit-html",{createHTML:r=>r}):void 0,ot="$lit$",y=`lit$${(Math.random()+"").slice(9)}$`,Ct="?"+y,qt=`<${Ct}>`,E=document,k=()=>E.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",xt=Array.isArray,Vt=r=>xt(r)||typeof r?.[Symbol.iterator]=="function",rt=`[
2
+ \f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,At=/>/g,A=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),St=/'/g,Et=/"/g,Pt=/^(?:script|style|textarea|title)$/i,Rt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),pt=Rt(1),ne=Rt(2),f=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),bt=new WeakMap,S=E.createTreeWalker(E,129,null,!1);function Tt(r,t){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return yt!==void 0?yt.createHTML(t):t}var Kt=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":"",n=U;for(let h=0;h<e;h++){let l=r[h],a,d,p=-1,u=0;for(;u<l.length&&(n.lastIndex=u,d=n.exec(l),d!==null);)u=n.lastIndex,n===U?d[1]==="!--"?n=$t:d[1]!==void 0?n=At:d[2]!==void 0?(Pt.test(d[2])&&(i=RegExp("</"+d[2],"g")),n=A):d[3]!==void 0&&(n=A):n===A?d[0]===">"?(n=i??U,p=-1):d[1]===void 0?p=-2:(p=n.lastIndex-d[2].length,a=d[1],n=d[3]===void 0?A:d[3]==='"'?Et:St):n===Et||n===St?n=A:n===$t||n===At?n=U:(n=A,i=void 0);let g=n===A&&r[h+1].startsWith("/>")?" ":"";o+=n===U?l+qt:p>=0?(s.push(a),l.slice(0,p)+ot+l.slice(p)+y+g):l+y+(p===-2?(s.push(void 0),h):g)}return[Tt(r,o+(r[e]||"<?>")+(t===2?"</svg>":"")),s]},D=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,l=this.parts,[a,d]=Kt(t,e);if(this.el=r.createElement(a,s),S.currentNode=this.el.content,e===2){let p=this.el.content,u=p.firstChild;u.remove(),p.append(...u.childNodes)}for(;(i=S.nextNode())!==null&&l.length<h;){if(i.nodeType===1){if(i.hasAttributes()){let p=[];for(let u of i.getAttributeNames())if(u.endsWith(ot)||u.startsWith(y)){let g=d[n++];if(p.push(u),g!==void 0){let Lt=i.getAttribute(g.toLowerCase()+ot).split(y),N=/([.?@])?(.*)/.exec(g);l.push({type:1,index:o,name:N[2],strings:Lt,ctor:N[1]==="."?lt:N[1]==="?"?at:N[1]==="@"?ht:P})}else l.push({type:6,index:o})}for(let u of p)i.removeAttribute(u)}if(Pt.test(i.tagName)){let p=i.textContent.split(y),u=p.length-1;if(u>0){i.textContent=C?C.emptyScript:"";for(let g=0;g<u;g++)i.append(p[g],k()),S.nextNode(),l.push({type:2,index:++o});i.append(p[u],k())}}}else if(i.nodeType===8)if(i.data===Ct)l.push({type:2,index:o});else{let p=-1;for(;(p=i.data.indexOf(y,p+1))!==-1;)l.push({type:7,index:o}),p+=y.length-1}o++}}static createElement(t,e){let s=E.createElement("template");return s.innerHTML=t,s}};function x(r,t,e=r,s){var i,o,n,h;if(t===f)return t;let l=s!==void 0?(i=e._$Co)===null||i===void 0?void 0:i[s]:e._$Cl,a=O(t)?void 0:t._$litDirective$;return l?.constructor!==a&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,e,s)),s!==void 0?((n=(h=e)._$Co)!==null&&n!==void 0?n:h._$Co=[])[s]=l:e._$Cl=l),l!==void 0&&(t=x(r,l._$AS(r,t.values),l,s)),t}var nt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;let{el:{content:s},parts:i}=this._$AD,o=((e=t?.creationScope)!==null&&e!==void 0?e:E).importNode(s,!0);S.currentNode=o;let n=S.nextNode(),h=0,l=0,a=i[0];for(;a!==void 0;){if(h===a.index){let d;a.type===2?d=new L(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new dt(n,this,t)),this._$AV.push(d),a=i[++l]}h!==a?.index&&(n=S.nextNode(),h++)}return S.currentNode=E,o}v(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class r{constructor(t,e,s,i){var o;this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cp=(o=i?.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),O(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Vt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==c&&O(this._$AH)?this._$AA.nextSibling.data=t:this.$(E.createTextNode(t)),this._$AH=t}g(t){var e;let{values:s,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=D.createElement(Tt(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(s);else{let n=new nt(o,this),h=n.u(this.options);n.v(s),this.$(h),this._$AH=n}}_$AC(t){let e=bt.get(t.strings);return e===void 0&&bt.set(t.strings,e=new D(t)),e}T(t){xt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.k(k()),this.k(k()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},P=class{constructor(t,e,s,i,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=x(this,t,e,0),n=!O(t)||t!==this._$AH&&t!==f,n&&(this._$AH=t);else{let h=t,l,a;for(t=o[0],l=0;l<o.length-1;l++)a=x(this,h[s+l],e,l),a===f&&(a=this._$AH[l]),n||(n=!O(a)||a!==this._$AH[l]),a===c?t=c:t!==c&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}n&&!i&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},lt=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}},Xt=C?C.emptyScript:"",at=class extends P{constructor(){super(...arguments),this.type=4}j(t){t&&t!==c?this.element.setAttribute(this.name,Xt):this.element.removeAttribute(this.name)}},ht=class extends P{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){var s;if((t=(s=x(this,t,e,0))!==null&&s!==void 0?s:c)===f)return;let i=this._$AH,o=t===c&&i!==c||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==c&&(i===c||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}},dt=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}};var wt=B.litHtmlPolyfillSupport;wt?.(D,L),((it=B.litHtmlVersions)!==null&&it!==void 0?it:B.litHtmlVersions=[]).push("2.8.0");var Mt=(r,t,e)=>{var s,i;let o=(s=e?.renderBefore)!==null&&s!==void 0?s:t,n=o._$litPart$;if(n===void 0){let h=(i=e?.renderBefore)!==null&&i!==void 0?i:null;o._$litPart$=n=new L(t.insertBefore(k(),h),h,void 0,e??{})}return n._$AI(r),n};var ct,ut;var $=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Mt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return f}};$.finalized=!0,$._$litElement$=!0,(ct=globalThis.litElementHydrateSupport)===null||ct===void 0||ct.call(globalThis,{LitElement:$});var Ut=globalThis.litElementPolyfillSupport;Ut?.({LitElement:$});((ut=globalThis.litElementVersions)!==null&&ut!==void 0?ut:globalThis.litElementVersions=[]).push("3.3.3");var Ft=(r,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,r)}},Jt=(r,t,e)=>{t.constructor.createProperty(e,r)};function q(r){return(t,e)=>e!==void 0?Jt(r,t,e):Ft(r,t)}function R(r){return q({...r,state:!0})}var b=({finisher:r,descriptor:t})=>(e,s)=>{var i;if(s===void 0){let o=(i=e.originalKey)!==null&&i!==void 0?i:e.key,n=t!=null?{kind:"method",placement:"prototype",key:o,descriptor:t(e.key)}:{...e,key:o};return r!=null&&(n.finisher=function(h){r(h,o)}),n}{let o=e.constructor;t!==void 0&&Object.defineProperty(e,s,t(s)),r?.(o,s)}};function w(r,t){return b({descriptor:e=>{let s={get(){var i,o;return(o=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(r))!==null&&o!==void 0?o:null},enumerable:!0,configurable:!0};if(t){let i=typeof e=="symbol"?Symbol():"__"+e;s.get=function(){var o,n;return this[i]===void 0&&(this[i]=(n=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&n!==void 0?n:null),this[i]}}return s}})}var vt,ke=((vt=window.HTMLSlotElement)===null||vt===void 0?void 0:vt.prototype.assignedElements)!=null?(r,t)=>r.assignedElements(t):(r,t)=>r.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);var V={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},K=r=>(...t)=>({_$litDirective$:r,values:t}),T=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var kt=K(class extends T{constructor(r){var t;if(super(r),r.type!==V.ATTRIBUTE||r.name!=="class"||((t=r.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(t=>r[t]).join(" ")+" "}update(r,[t]){var e,s;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in t)t[o]&&!(!((e=this.nt)===null||e===void 0)&&e.has(o))&&this.it.add(o);return this.render(t)}let i=r.element.classList;this.it.forEach(o=>{o in t||(i.remove(o),this.it.delete(o))});for(let o in t){let n=!!t[o];n===this.it.has(o)||!((s=this.nt)===null||s===void 0)&&s.has(o)||(n?(i.add(o),this.it.add(o)):(i.remove(o),this.it.delete(o)))}return f}});var Ot="important",Zt=" !"+Ot,X=K(class extends T{constructor(r){var t;if(super(r),r.type!==V.ATTRIBUTE||r.name!=="style"||((t=r.strings)===null||t===void 0?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,e)=>{let s=r[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(r,[t]){let{style:e}=r.element;if(this.ht===void 0){this.ht=new Set;for(let s in t)this.ht.add(s);return this.render(t)}this.ht.forEach(s=>{t[s]==null&&(this.ht.delete(s),s.includes("-")?e.removeProperty(s):e[s]="")});for(let s in t){let i=t[s];if(i!=null){this.ht.add(s);let o=typeof i=="string"&&i.endsWith(Zt);s.includes("-")||o?e.setProperty(s,o?i.slice(0,-11):i,o?Ot:""):e[s]=i}}return f}});var Yt=":host{display:block;--sd-splitter-gap: 0px;--sd-splitter-cursor: ew-resize;--sd-splitter-width: 0px;--sd-splitter-color: transparent;--sd-splitter-handle-width: 5px;--sd-splitter-handle-color: #1467ba}#root{display:flex;height:100%;width:100%;justify-content:space-between;gap:var(--sd-splitter-gap)}.pane{overflow:hidden}::slotted([slot=left]),::slotted([slot=right]){width:100%;height:100%}::slotted([slot=splitter]){flex:none;touch-action:none}#default-splitter{flex:none;touch-action:none;width:var(--sd-splitter-width);position:relative;background-color:var(--sd-splitter-color)}#default-splitter-handle{position:absolute;top:0;left:calc((var(--sd-splitter-width) - var(--sd-splitter-handle-width)) / 2);right:0;bottom:0;width:var(--sd-splitter-handle-width);background-color:var(--sd-splitter-handle-color);opacity:0;transition:opacity .2s}#default-splitter-drag-area{position:absolute;top:0;left:-3px;width:calc(var(--sd-splitter-handle-width) + 6px);bottom:0}#default-splitter-handle.hover,#default-splitter-handle.drag{opacity:1}#default-splitter-handle.hover{transition-delay:.5s}#default-splitter-handle.drag{transition:none}",Gt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,_=(r,t,e,s)=>{for(var i=s>1?void 0:s?Qt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Gt(t,e,i),i},Dt=class extends ${constructor(){super(),this.ratio=[1,1],this._hovering=!1,this._dragging=!1,this._startX=0,this._startLeftWidth=0,this._onLeftSlotChange=()=>{this._assignSlotted("left",this._leftSlot,t=>{this._leftSlotted=t})},this._onRightSlotChange=()=>{this._assignSlotted("right",this._rightSlot,t=>{this._rightSlotted=t})},this._onSplitterSlotChange=()=>{if(this._customSplitterCleanup&&(this._customSplitterCleanup(),this._customSplitterCleanup=void 0),this._assignSlotted("splitter",this._splitterSlot,t=>{this._customSplitter=t}),this._customSplitter){let t=this._customSplitter.querySelector(".sd-splitter-drag-area")||this._customSplitter;t.addEventListener("pointerenter",this._enterDragArea),t.addEventListener("pointerleave",this._leaveDragArea),t.addEventListener("pointerdown",this._startDrag),this._customSplitterCleanup=()=>{t.removeEventListener("pointerenter",this._enterDragArea),t.removeEventListener("pointerleave",this._leaveDragArea),t.removeEventListener("pointerdown",this._startDrag)}}},this._enterDragArea=()=>{this._hovering=!0,this.setAttribute("hovering","")},this._leaveDragArea=()=>{this._hovering=!1,this._dragging||this.removeAttribute("hovering")},this._startDrag=t=>{this._dragging=!0,this.setAttribute("dragging",""),this._startX=t.clientX,this._startLeftWidth=this._leftPane.offsetWidth,window.addEventListener("pointermove",this._doDrag),window.addEventListener("pointerup",this._endDrag),window.addEventListener("contextmenu",this._preventContextMenu),window.document.body.style.cursor=getComputedStyle(this).getPropertyValue("--sd-splitter-cursor"),t.preventDefault()},this._doDrag=t=>{if(!this._dragging)return;let e=t.clientX-this._startX;this._recomputeRatio(this._startLeftWidth+e)},this._endDrag=()=>{this._dragging=!1,this.removeAttribute("dragging"),this._hovering||this.removeAttribute("hovering"),window.removeEventListener("pointermove",this._doDrag),window.removeEventListener("pointerup",this._endDrag),window.removeEventListener("contextmenu",this._preventContextMenu),window.document.body.style.removeProperty("cursor")},this._preventContextMenu=t=>{t.preventDefault()},this._resizeObserver=new ResizeObserver(()=>{this._handleResize()})}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.unobserve(this)}_assignSlotted(t,e,s){e.assignedElements().length>1&&console.warn(`At most one element can be assigned to slot '${t}' in sd-splitter.`),s(e.assignedElements()[0])}_handleResize(){!this._leftSlotted||!this._rightSlotted||this._recomputeRatio(this._leftPane.offsetWidth)}_recomputeRatio(t){let e=this._getAvailableWidth();if(e<=0)return;let[s,i]=this._getMinMaxWidth(this._leftSlot),[o,n]=this._getMinMaxWidth(this._rightSlot),h=Math.max(s,e-n),l=Math.min(i,e-o),a=Math.max(h,Math.min(t,l)),d=e-a;this._setRatio(a,d)}_getAvailableWidth(){let t=parseFloat(getComputedStyle(this._root).getPropertyValue("gap"))||0;return this.offsetWidth-this._getSplitter().offsetWidth-2*t}_getSplitter(){return this._customSplitter||this._defaultSplitter}_getMinMaxWidth(t){let e=getComputedStyle(t.assignedElements()[0]);return[parseFloat(e.minWidth)||0,parseFloat(e.maxWidth)||1/0]}_setRatio(t,e){let s=t+e;if(s===0)return[.5,.5];this.ratio=[t/s,e/s],this.dispatchEvent(new F(this.ratio))}render(){if(!this._leftSlotted||!this._rightSlotted)return pt`
4
+ <div id="root">
5
+ <slot name="left" @slotchange=${this._onLeftSlotChange} ?hidden=${!this._leftSlotted}></slot>
6
+ <slot name="splitter" @slotchange=${this._onSplitterSlotChange} ?hidden=${!0}></slot>
7
+ <slot name="right" @slotchange=${this._onRightSlotChange} ?hidden=${!this._rightSlotted}></slot>
8
+ </div>
9
+ `;let[t,e]=this.ratio,s=this._hovering?getComputedStyle(this).getPropertyValue("--sd-splitter-cursor"):"inherit";return pt`
10
+ <div id="root" style=${X({cursor:s})}>
11
+ <div id="left" class="pane" style=${X({flex:t+" "+t+" 0"})}>
12
+ <slot name="left" @slotchange=${this._onLeftSlotChange}></slot>
13
+ </div>
14
+ <slot name="splitter" @slotchange=${this._onSplitterSlotChange}>
15
+ <div id="default-splitter">
16
+ <div
17
+ id="default-splitter-handle"
18
+ class=${kt({hover:this._hovering,drag:this._dragging})}
19
+ >
20
+ <div
21
+ id="default-splitter-drag-area"
22
+ @pointerenter=${this._enterDragArea}
23
+ @pointerleave=${this._leaveDragArea}
24
+ @pointerdown=${this._startDrag}
25
+ ></div>
26
+ </div>
27
+ </div>
28
+ </slot>
29
+ <div id="right" class="pane" style=${X({flex:e+" "+e+" 0"})}>
30
+ <slot name="right" @slotchange=${this._onRightSlotChange}></slot>
31
+ </div>
32
+ </div>
33
+ `}static get styles(){return[Y`
34
+ ${z(Yt)}
35
+ `]}};Dt.ID="sd-splitter";var v=Dt;_([q({type:Array,reflect:!0})],v.prototype,"ratio",2);_([w("#root",!0)],v.prototype,"_root",2);_([w("#left")],v.prototype,"_leftPane",2);_([w('slot[name="left"]')],v.prototype,"_leftSlot",2);_([w('slot[name="right"]')],v.prototype,"_rightSlot",2);_([w('slot[name="splitter"]')],v.prototype,"_splitterSlot",2);_([w("#default-splitter")],v.prototype,"_defaultSplitter",2);_([R()],v.prototype,"_leftSlotted",2);_([R()],v.prototype,"_rightSlotted",2);_([R()],v.prototype,"_customSplitter",2);_([R()],v.prototype,"_hovering",2);_([R()],v.prototype,"_dragging",2);customElements.get(v.ID)||customElements.define(v.ID,v);var F=class extends Event{constructor(t){super("sd-splitter-resized",{bubbles:!0,composed:!0}),this.ratio=t}};return Wt(te);})();
36
+ /*! Bundled license information:
37
+
38
+ @lit/reactive-element/css-tag.js:
39
+ (**
40
+ * @license
41
+ * Copyright 2019 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ *)
44
+
45
+ @lit/reactive-element/reactive-element.js:
46
+ (**
47
+ * @license
48
+ * Copyright 2017 Google LLC
49
+ * SPDX-License-Identifier: BSD-3-Clause
50
+ *)
51
+
52
+ lit-html/lit-html.js:
53
+ (**
54
+ * @license
55
+ * Copyright 2017 Google LLC
56
+ * SPDX-License-Identifier: BSD-3-Clause
57
+ *)
58
+
59
+ lit-element/lit-element.js:
60
+ (**
61
+ * @license
62
+ * Copyright 2017 Google LLC
63
+ * SPDX-License-Identifier: BSD-3-Clause
64
+ *)
65
+
66
+ lit-html/is-server.js:
67
+ (**
68
+ * @license
69
+ * Copyright 2022 Google LLC
70
+ * SPDX-License-Identifier: BSD-3-Clause
71
+ *)
72
+
73
+ @lit/reactive-element/decorators/custom-element.js:
74
+ (**
75
+ * @license
76
+ * Copyright 2017 Google LLC
77
+ * SPDX-License-Identifier: BSD-3-Clause
78
+ *)
79
+
80
+ @lit/reactive-element/decorators/property.js:
81
+ (**
82
+ * @license
83
+ * Copyright 2017 Google LLC
84
+ * SPDX-License-Identifier: BSD-3-Clause
85
+ *)
86
+
87
+ @lit/reactive-element/decorators/state.js:
88
+ (**
89
+ * @license
90
+ * Copyright 2017 Google LLC
91
+ * SPDX-License-Identifier: BSD-3-Clause
92
+ *)
93
+
94
+ @lit/reactive-element/decorators/base.js:
95
+ (**
96
+ * @license
97
+ * Copyright 2017 Google LLC
98
+ * SPDX-License-Identifier: BSD-3-Clause
99
+ *)
100
+
101
+ @lit/reactive-element/decorators/event-options.js:
102
+ (**
103
+ * @license
104
+ * Copyright 2017 Google LLC
105
+ * SPDX-License-Identifier: BSD-3-Clause
106
+ *)
107
+
108
+ @lit/reactive-element/decorators/query.js:
109
+ (**
110
+ * @license
111
+ * Copyright 2017 Google LLC
112
+ * SPDX-License-Identifier: BSD-3-Clause
113
+ *)
114
+
115
+ @lit/reactive-element/decorators/query-all.js:
116
+ (**
117
+ * @license
118
+ * Copyright 2017 Google LLC
119
+ * SPDX-License-Identifier: BSD-3-Clause
120
+ *)
121
+
122
+ @lit/reactive-element/decorators/query-async.js:
123
+ (**
124
+ * @license
125
+ * Copyright 2017 Google LLC
126
+ * SPDX-License-Identifier: BSD-3-Clause
127
+ *)
128
+
129
+ @lit/reactive-element/decorators/query-assigned-elements.js:
130
+ (**
131
+ * @license
132
+ * Copyright 2021 Google LLC
133
+ * SPDX-License-Identifier: BSD-3-Clause
134
+ *)
135
+
136
+ @lit/reactive-element/decorators/query-assigned-nodes.js:
137
+ (**
138
+ * @license
139
+ * Copyright 2017 Google LLC
140
+ * SPDX-License-Identifier: BSD-3-Clause
141
+ *)
142
+
143
+ lit-html/directive.js:
144
+ (**
145
+ * @license
146
+ * Copyright 2017 Google LLC
147
+ * SPDX-License-Identifier: BSD-3-Clause
148
+ *)
149
+
150
+ lit-html/directives/class-map.js:
151
+ (**
152
+ * @license
153
+ * Copyright 2018 Google LLC
154
+ * SPDX-License-Identifier: BSD-3-Clause
155
+ *)
156
+
157
+ lit-html/directives/style-map.js:
158
+ (**
159
+ * @license
160
+ * Copyright 2018 Google LLC
161
+ * SPDX-License-Identifier: BSD-3-Clause
162
+ *)
163
+ */
164
+ //# sourceMappingURL=splitter-with-externals.js.map