alchemy_cms 7.1.0.pre.b1 → 7.1.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/alchemy_cms.gemspec +1 -1
- data/app/assets/config/alchemy_manifest.js +3 -4
- data/app/assets/images/alchemy/missing-image.svg +1 -1
- data/app/assets/javascripts/alchemy/admin.js +0 -4
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +4 -4
- data/app/assets/javascripts/tinymce/icons/remixicons/icons.js +93 -0
- data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +37 -18
- data/app/assets/stylesheets/alchemy/_variables.scss +11 -3
- data/app/assets/stylesheets/alchemy/archive.scss +5 -2
- data/app/assets/stylesheets/alchemy/buttons.scss +5 -4
- data/app/assets/stylesheets/alchemy/dialogs.scss +1 -1
- data/app/assets/stylesheets/alchemy/elements.scss +4 -5
- data/app/assets/stylesheets/alchemy/filter_field.scss +5 -0
- data/app/assets/stylesheets/tinymce/skins/content/alchemy/content.min.scss +69 -0
- data/app/assets/stylesheets/tinymce/skins/skintool.json +38 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +711 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +705 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +29 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.min.scss +3803 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +677 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +7 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +9 -4
- data/app/helpers/alchemy/admin/base_helper.rb +23 -10
- data/app/helpers/alchemy/base_helper.rb +16 -1
- data/app/javascript/alchemy_admin/components/button.js +1 -1
- data/app/javascript/alchemy_admin/components/clipboard_button.js +27 -0
- data/app/javascript/alchemy_admin/components/element_editor.js +2 -2
- data/app/javascript/alchemy_admin/components/tinymce.js +9 -21
- data/app/javascript/alchemy_admin/picture_editors.js +4 -2
- data/app/javascript/alchemy_admin/utils/debounce.js +10 -0
- data/app/javascript/alchemy_admin/utils/max.js +3 -0
- data/app/javascript/alchemy_admin.js +4 -10
- data/app/models/alchemy/page/page_naming.rb +7 -0
- data/app/models/alchemy/page.rb +2 -2
- data/app/models/alchemy/picture_variant.rb +11 -2
- data/app/models/concerns/alchemy/picture_thumbnails.rb +1 -1
- data/app/views/alchemy/admin/attachments/show.html.erb +10 -19
- data/app/views/alchemy/admin/crop.html.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +1 -0
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +0 -1
- data/app/views/alchemy/admin/pictures/_archive.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +16 -3
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -5
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_filter.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +1 -2
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +2 -2
- data/app/views/layouts/alchemy/admin.html.erb +1 -1
- data/bundles/shoelace.js +10 -0
- data/bundles/tinymce.js +20 -0
- data/config/alchemy/config.yml +11 -10
- data/config/brakeman.ignore +0 -34
- data/config/importmap.rb +9 -14
- data/config/initializers/dragonfly.rb +1 -0
- data/config/locales/alchemy.en.yml +2 -0
- data/eslint.config.js +17 -0
- data/lib/alchemy/config.rb +24 -2
- data/lib/alchemy/engine.rb +2 -1
- data/lib/alchemy/forms/builder.rb +7 -0
- data/lib/alchemy/test_support/capybara_helpers.rb +1 -1
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +6 -6
- data/lib/alchemy/tinymce.rb +13 -2
- data/lib/alchemy/version.rb +1 -1
- data/package.json +20 -6
- data/rollup.config.mjs +65 -0
- data/vendor/assets/stylesheets/tinymce/skins/content/default/content.min.css +1 -0
- data/vendor/javascript/clipboard.min.js +7 -0
- data/vendor/javascript/flatpickr.min.js +1 -0
- data/vendor/javascript/keymaster.min.js +1 -0
- data/vendor/javascript/rails-ujs.min.js +1 -0
- data/vendor/javascript/shoelace.min.js +995 -0
- data/vendor/javascript/sortable.min.js +7 -0
- data/vendor/javascript/tinymce.min.js +1 -0
- data/vendor/javascript/ungap-custom-elements.min.js +3 -0
- metadata +31 -39
- data/.codeclimate.yml +0 -35
- data/.editorconfig +0 -23
- data/.github/FUNDING.yml +0 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -22
- data/.github/ISSUE_TEMPLATE/Feature_request.md +0 -17
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -18
- data/.github/workflows/backport.yml +0 -36
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/lint.yml +0 -37
- data/.github/workflows/stale.yml +0 -33
- data/.github/workflows/test.yml +0 -125
- data/.gitignore +0 -32
- data/.hound.yml +0 -9
- data/.localeapp/config.rb +0 -8
- data/.prettierrc +0 -6
- data/.rspec +0 -1
- data/.rubocop.yml +0 -7
- data/.standard.yml +0 -4
- data/.yardopts +0 -5
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +0 -94
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +0 -63
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +0 -129
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/anchor.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/loader.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/object.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/trans.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +0 -2077
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +0 -10
- data/vendor/assets/javascripts/clipboard.min.js +0 -7
- data/vendor/assets/javascripts/keymaster.js +0 -296
- data/vendor/assets/javascripts/requestAnimationFrame.js +0 -31
- data/vendor/assets/javascripts/tinymce/license.txt +0 -504
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +0 -2
@@ -0,0 +1,995 @@
|
|
1
|
+
var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,l=(t,e)=>{for(var i in e||(e={}))r.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))n.call(e,i)&&a(t,i,e[i]);return t},c=(t,i)=>e(t,o(i)),h=(e,o,s,r)=>{for(var n,a=r>1?void 0:r?i(o,s):o,l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r?n(o,s,a):n(a))||a);return r&&a&&t(o,s,a),a},d=new Map,p=new WeakMap;function u(t,e){return"rtl"===e.toLowerCase()?{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}:t}function f(t,e){d.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function b(t,e,i){const o=p.get(t);if(null==o?void 0:o[e])return u(o[e],i.dir);const s=d.get(e);return s?u(s,i.dir):{keyframes:[],options:{duration:0}}}
|
2
|
+
/**
|
3
|
+
* @license
|
4
|
+
* Copyright 2019 Google LLC
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
+
*/const g=globalThis,m=g.ShadowRoot&&(void 0===g.ShadyCSS||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,v=Symbol(),y=new WeakMap;let w=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==v)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(m&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=y.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&y.set(e,t))}return t}toString(){return this.cssText}};const _=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new w(i,t,v)},$=m?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new w("string"==typeof t?t:t+"",void 0,v))(e)})(t):t
|
7
|
+
/**
|
8
|
+
* @license
|
9
|
+
* Copyright 2017 Google LLC
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
+
*/,{is:x,defineProperty:k,getOwnPropertyDescriptor:A,getOwnPropertyNames:C,getOwnPropertySymbols:E,getPrototypeOf:S}=Object,z=globalThis,T=z.trustedTypes,P=T?T.emptyScript:"",L=z.reactiveElementPolyfillSupport,O=(t,e)=>t,M={toAttribute(t,e){switch(e){case Boolean:t=t?P:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},R=(t,e)=>!x(t,e),B={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:R};Symbol.metadata??=Symbol("metadata"),z.litPropertyMetadata??=new WeakMap;class F extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=B){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&k(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:s}=A(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return o?.call(this)},set(e){const r=o?.call(this);s.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??B}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=S(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const t=this.properties,e=[...C(t),...E(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift($(t))}else void 0!==t&&e.push($(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(m)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=g.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:M).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:M;this._$Em=o,this[o]=s.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i,o=!1,s){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??R)(o?s:this[t],e))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}F.elementStyles=[],F.shadowRootOptions={mode:"open"},F[O("elementProperties")]=new Map,F[O("finalized")]=new Map,L?.({ReactiveElement:F}),(z.reactiveElementVersions??=[]).push("2.0.2");
|
12
|
+
/**
|
13
|
+
* @license
|
14
|
+
* Copyright 2017 Google LLC
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
16
|
+
*/
|
17
|
+
const D=globalThis,U=D.trustedTypes,H=U?U.createPolicy("lit-html",{createHTML:t=>t}):void 0,V="$lit$",N=`lit$${(Math.random()+"").slice(9)}$`,I="?"+N,j=`<${I}>`,W=document,q=()=>W.createComment(""),K=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Z=Array.isArray,G="[ \t\n\f\r]",Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,J=/-->/g,X=/>/g,Q=RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,it=/^(?:script|style|textarea|title)$/i,ot=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),st=Symbol.for("lit-noChange"),rt=Symbol.for("lit-nothing"),nt=new WeakMap,at=W.createTreeWalker(W,129);function lt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==H?H.createHTML(e):e}const ct=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":"",n=Y;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,h=0;for(;h<i.length&&(n.lastIndex=h,l=n.exec(i),null!==l);)h=n.lastIndex,n===Y?"!--"===l[1]?n=J:void 0!==l[1]?n=X:void 0!==l[2]?(it.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=Q):void 0!==l[3]&&(n=Q):n===Q?">"===l[0]?(n=s??Y,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?Q:'"'===l[3]?et:tt):n===et||n===tt?n=Q:n===J||n===X?n=Y:(n=Q,s=void 0);const d=n===Q&&t[e+1].startsWith("/>")?" ":"";r+=n===Y?i+j:c>=0?(o.push(a),i.slice(0,c)+V+i.slice(c)+N+d):i+N+(-2===c?e:d)}return[lt(t,r+(t[i]||"<?>")+(2===e?"</svg>":"")),o]};class ht{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,a=this.parts,[l,c]=ct(t,e);if(this.el=ht.createElement(l,i),at.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=at.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(V)){const e=c[r++],i=o.getAttribute(t).split(N),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?bt:"?"===n[1]?gt:"@"===n[1]?mt:ft}),o.removeAttribute(t)}else t.startsWith(N)&&(a.push({type:6,index:s}),o.removeAttribute(t));if(it.test(o.tagName)){const t=o.textContent.split(N),e=t.length-1;if(e>0){o.textContent=U?U.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],q()),at.nextNode(),a.push({type:2,index:++s});o.append(t[e],q())}}}else if(8===o.nodeType)if(o.data===I)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(N,t+1));)a.push({type:7,index:s}),t+=N.length-1}s++}}static createElement(t,e){const i=W.createElement("template");return i.innerHTML=t,i}}function dt(t,e,i=t,o){if(e===st)return e;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=K(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(t),s._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(e=dt(t,s._$AS(t,e.values),s,o)),e}class pt{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){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??W).importNode(e,!0);at.currentNode=o;let s=at.nextNode(),r=0,n=0,a=i[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new ut(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new vt(s,this,t)),this._$AV.push(e),a=i[++n]}r!==a?.index&&(s=at.nextNode(),r++)}return at.currentNode=W,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class ut{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=rt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=dt(this,t,e),K(t)?t===rt||null==t||""===t?(this._$AH!==rt&&this._$AR(),this._$AH=rt):t!==this._$AH&&t!==st&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>Z(t)||"function"==typeof t?.[Symbol.iterator])(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!==rt&&K(this._$AH)?this._$AA.nextSibling.data=t:this.$(W.createTextNode(t)),this._$AH=t}g(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=ht.createElement(lt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new pt(o,this),i=t.u(this.options);t.p(e),this.$(i),this._$AH=t}}_$AC(t){let e=nt.get(t.strings);return void 0===e&&nt.set(t.strings,e=new ht(t)),e}T(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new ut(this.k(q()),this.k(q()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class ft{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,s){this.type=1,this._$AH=rt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=rt}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=dt(this,t,e,0),r=!K(t)||t!==this._$AH&&t!==st,r&&(this._$AH=t);else{const o=t;let n,a;for(t=s[0],n=0;n<s.length-1;n++)a=dt(this,o[i+n],e,n),a===st&&(a=this._$AH[n]),r||=!K(a)||a!==this._$AH[n],a===rt?t=rt:t!==rt&&(t+=(a??"")+s[n+1]),this._$AH[n]=a}r&&!o&&this.O(t)}O(t){t===rt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bt extends ft{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===rt?void 0:t}}class gt extends ft{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==rt)}}class mt extends ft{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){if((t=dt(this,t,e,0)??rt)===st)return;const i=this._$AH,o=t===rt&&i!==rt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==rt&&(i===rt||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class vt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){dt(this,t)}}const yt=D.litHtmlPolyfillSupport;yt?.(ht,ut),(D.litHtmlVersions??=[]).push("3.1.0");
|
18
|
+
/**
|
19
|
+
* @license
|
20
|
+
* Copyright 2017 Google LLC
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
22
|
+
*/
|
23
|
+
let wt=class extends F{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let s=o._$litPart$;if(void 0===s){const t=i?.renderBefore??null;o._$litPart$=s=new ut(e.insertBefore(q(),t),t,void 0,i??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return st}};wt._$litElement$=!0,wt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:wt});const _t=globalThis.litElementPolyfillSupport;_t?.({LitElement:wt}),(globalThis.litElementVersions??=[]).push("4.0.2");var $t=_`
|
24
|
+
:host {
|
25
|
+
box-sizing: border-box;
|
26
|
+
}
|
27
|
+
|
28
|
+
:host *,
|
29
|
+
:host *::before,
|
30
|
+
:host *::after {
|
31
|
+
box-sizing: inherit;
|
32
|
+
}
|
33
|
+
|
34
|
+
[hidden] {
|
35
|
+
display: none !important;
|
36
|
+
}
|
37
|
+
`,xt=_`
|
38
|
+
${$t}
|
39
|
+
|
40
|
+
:host {
|
41
|
+
display: inline-block;
|
42
|
+
}
|
43
|
+
|
44
|
+
:host([size='small']) {
|
45
|
+
--height: var(--sl-toggle-size-small);
|
46
|
+
--thumb-size: calc(var(--sl-toggle-size-small) + 4px);
|
47
|
+
--width: calc(var(--height) * 2);
|
48
|
+
|
49
|
+
font-size: var(--sl-input-font-size-small);
|
50
|
+
}
|
51
|
+
|
52
|
+
:host([size='medium']) {
|
53
|
+
--height: var(--sl-toggle-size-medium);
|
54
|
+
--thumb-size: calc(var(--sl-toggle-size-medium) + 4px);
|
55
|
+
--width: calc(var(--height) * 2);
|
56
|
+
|
57
|
+
font-size: var(--sl-input-font-size-medium);
|
58
|
+
}
|
59
|
+
|
60
|
+
:host([size='large']) {
|
61
|
+
--height: var(--sl-toggle-size-large);
|
62
|
+
--thumb-size: calc(var(--sl-toggle-size-large) + 4px);
|
63
|
+
--width: calc(var(--height) * 2);
|
64
|
+
|
65
|
+
font-size: var(--sl-input-font-size-large);
|
66
|
+
}
|
67
|
+
|
68
|
+
.switch {
|
69
|
+
position: relative;
|
70
|
+
display: inline-flex;
|
71
|
+
align-items: center;
|
72
|
+
font-family: var(--sl-input-font-family);
|
73
|
+
font-size: inherit;
|
74
|
+
font-weight: var(--sl-input-font-weight);
|
75
|
+
color: var(--sl-input-label-color);
|
76
|
+
vertical-align: middle;
|
77
|
+
cursor: pointer;
|
78
|
+
}
|
79
|
+
|
80
|
+
.switch__control {
|
81
|
+
flex: 0 0 auto;
|
82
|
+
position: relative;
|
83
|
+
display: inline-flex;
|
84
|
+
align-items: center;
|
85
|
+
justify-content: center;
|
86
|
+
width: var(--width);
|
87
|
+
height: var(--height);
|
88
|
+
background-color: var(--sl-color-neutral-400);
|
89
|
+
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
90
|
+
border-radius: var(--height);
|
91
|
+
transition:
|
92
|
+
var(--sl-transition-fast) border-color,
|
93
|
+
var(--sl-transition-fast) background-color;
|
94
|
+
}
|
95
|
+
|
96
|
+
.switch__control .switch__thumb {
|
97
|
+
width: var(--thumb-size);
|
98
|
+
height: var(--thumb-size);
|
99
|
+
background-color: var(--sl-color-neutral-0);
|
100
|
+
border-radius: 50%;
|
101
|
+
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
102
|
+
translate: calc((var(--width) - var(--height)) / -2);
|
103
|
+
transition:
|
104
|
+
var(--sl-transition-fast) translate ease,
|
105
|
+
var(--sl-transition-fast) background-color,
|
106
|
+
var(--sl-transition-fast) border-color,
|
107
|
+
var(--sl-transition-fast) box-shadow;
|
108
|
+
}
|
109
|
+
|
110
|
+
.switch__input {
|
111
|
+
position: absolute;
|
112
|
+
opacity: 0;
|
113
|
+
padding: 0;
|
114
|
+
margin: 0;
|
115
|
+
pointer-events: none;
|
116
|
+
}
|
117
|
+
|
118
|
+
/* Hover */
|
119
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
|
120
|
+
background-color: var(--sl-color-neutral-400);
|
121
|
+
border-color: var(--sl-color-neutral-400);
|
122
|
+
}
|
123
|
+
|
124
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
|
125
|
+
background-color: var(--sl-color-neutral-0);
|
126
|
+
border-color: var(--sl-color-neutral-400);
|
127
|
+
}
|
128
|
+
|
129
|
+
/* Focus */
|
130
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
131
|
+
background-color: var(--sl-color-neutral-400);
|
132
|
+
border-color: var(--sl-color-neutral-400);
|
133
|
+
}
|
134
|
+
|
135
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
136
|
+
background-color: var(--sl-color-neutral-0);
|
137
|
+
border-color: var(--sl-color-primary-600);
|
138
|
+
outline: var(--sl-focus-ring);
|
139
|
+
outline-offset: var(--sl-focus-ring-offset);
|
140
|
+
}
|
141
|
+
|
142
|
+
/* Checked */
|
143
|
+
.switch--checked .switch__control {
|
144
|
+
background-color: var(--sl-color-primary-600);
|
145
|
+
border-color: var(--sl-color-primary-600);
|
146
|
+
}
|
147
|
+
|
148
|
+
.switch--checked .switch__control .switch__thumb {
|
149
|
+
background-color: var(--sl-color-neutral-0);
|
150
|
+
border-color: var(--sl-color-primary-600);
|
151
|
+
translate: calc((var(--width) - var(--height)) / 2);
|
152
|
+
}
|
153
|
+
|
154
|
+
/* Checked + hover */
|
155
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover {
|
156
|
+
background-color: var(--sl-color-primary-600);
|
157
|
+
border-color: var(--sl-color-primary-600);
|
158
|
+
}
|
159
|
+
|
160
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {
|
161
|
+
background-color: var(--sl-color-neutral-0);
|
162
|
+
border-color: var(--sl-color-primary-600);
|
163
|
+
}
|
164
|
+
|
165
|
+
/* Checked + focus */
|
166
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
167
|
+
background-color: var(--sl-color-primary-600);
|
168
|
+
border-color: var(--sl-color-primary-600);
|
169
|
+
}
|
170
|
+
|
171
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
172
|
+
background-color: var(--sl-color-neutral-0);
|
173
|
+
border-color: var(--sl-color-primary-600);
|
174
|
+
outline: var(--sl-focus-ring);
|
175
|
+
outline-offset: var(--sl-focus-ring-offset);
|
176
|
+
}
|
177
|
+
|
178
|
+
/* Disabled */
|
179
|
+
.switch--disabled {
|
180
|
+
opacity: 0.5;
|
181
|
+
cursor: not-allowed;
|
182
|
+
}
|
183
|
+
|
184
|
+
.switch__label {
|
185
|
+
display: inline-block;
|
186
|
+
line-height: var(--height);
|
187
|
+
margin-inline-start: 0.5em;
|
188
|
+
user-select: none;
|
189
|
+
-webkit-user-select: none;
|
190
|
+
}
|
191
|
+
|
192
|
+
:host([required]) .switch__label::after {
|
193
|
+
content: var(--sl-input-required-content);
|
194
|
+
margin-inline-start: var(--sl-input-required-content-offset);
|
195
|
+
}
|
196
|
+
|
197
|
+
@media (forced-colors: active) {
|
198
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,
|
199
|
+
.switch--checked .switch__control .switch__thumb {
|
200
|
+
background-color: ButtonText;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
`,kt=new WeakMap,At=new WeakMap,Ct=new WeakMap,Et=new WeakSet,St=new WeakMap,zt=class{constructor(t,e){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),o=this.options.value(this.host),s="sl-button"===this.host.tagName.toLowerCase();!e&&!s&&"string"==typeof i&&i.length>0&&void 0!==o&&(Array.isArray(o)?o.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,o.toString()))},this.handleFormSubmit=t=>{var e;const i=this.options.disabled(this.host),o=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=kt.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),!this.form||this.form.noValidate||i||o(this.host)||(t.preventDefault(),t.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),St.set(this.host,[])},this.handleInteraction=t=>{const e=St.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.checkValidity&&!e.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0},(this.host=t).addController(this),this.options=l({form:t=>{const e=t.form;if(e){const i=t.getRootNode().getElementById(e);if(i)return i}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>{var e;return null!=(e=t.disabled)&&e},reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),checkValidity:t=>"function"!=typeof t.checkValidity||t.checkValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sl-input"]},e)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),St.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),St.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,kt.has(this.form)?kt.get(this.form).add(this.host):kt.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),At.has(this.form)||(At.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),Ct.has(this.form)||(Ct.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const t=kt.get(this.form);t&&(t.delete(this.host),t.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),At.has(this.form)&&(this.form.reportValidity=At.get(this.form),At.delete(this.form)),Ct.has(this.form)&&(this.form.checkValidity=Ct.get(this.form),Ct.delete(this.form)),this.form=void 0))}setUserInteracted(t,e){e?Et.add(t):Et.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}getForm(){var t;return null!=(t=this.form)?t:null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,i=Boolean(Et.has(e)),o=Boolean(e.required);e.toggleAttribute("data-required",o),e.toggleAttribute("data-optional",!o),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&i),e.toggleAttribute("data-user-valid",t&&i)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||null==t||t.preventDefault()}},Tt=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});function Pt(t,e){const i=l({waitUntilFirstUpdate:!1},e);return(e,o)=>{const{update:s}=e,r=Array.isArray(t)?t:[t];e.update=function(t){r.forEach((e=>{const s=e;if(t.has(s)){const e=t.get(s),r=this[s];e!==r&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[o](e,r))}})),s.call(this,t)}}}
|
204
|
+
/**
|
205
|
+
* @license
|
206
|
+
* Copyright 2017 Google LLC
|
207
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
208
|
+
*/Object.freeze(c(l({},Tt),{valid:!1,valueMissing:!0})),Object.freeze(c(l({},Tt),{valid:!1,customError:!0}));const Lt={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:R},Ot=(t=Lt,e,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,s,t)},init(e){return void 0!==e&&this.C(o,void 0,t),e}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];e.call(this,i),this.requestUpdate(o,s,t)}}throw Error("Unsupported decorator location: "+o)};function Mt(t){return(e,i)=>"object"==typeof i?Ot(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
|
209
|
+
/**
|
210
|
+
* @license
|
211
|
+
* Copyright 2017 Google LLC
|
212
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
213
|
+
*/}function Rt(t){return Mt({...t,state:!0,attribute:!1})}
|
214
|
+
/**
|
215
|
+
* @license
|
216
|
+
* Copyright 2017 Google LLC
|
217
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
218
|
+
*/const Bt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i)
|
219
|
+
/**
|
220
|
+
* @license
|
221
|
+
* Copyright 2017 Google LLC
|
222
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
223
|
+
*/;function Ft(t,e){return(i,o,s)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof o?i:s??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return Bt(i,o,{get(){let i=t.call(this);return void 0===i&&(i=r(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return Bt(i,o,{get(){return r(this)}})}}var Dt=class extends wt{constructor(){super(),Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const i=new CustomEvent(t,l({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){const o=customElements.get(t);if(!o)return void customElements.define(t,class extends e{},i);let s=" (unknown version)",r=s;"version"in e&&e.version&&(s=" v"+e.version),"version"in o&&o.version&&(r=" v"+o.version),s&&r&&s===r||console.warn(`Attempted to register <${t}>${s}, but <${t}>${r} has already been registered.`)}};Dt.version="2.12.0",Dt.dependencies={},h([Mt()],Dt.prototype,"dir",2),h([Mt()],Dt.prototype,"lang",2);
|
224
|
+
/**
|
225
|
+
* @license
|
226
|
+
* Copyright 2017 Google LLC
|
227
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
228
|
+
*/
|
229
|
+
const Ut=1,Ht=3,Vt=4,Nt=t=>(...e)=>({_$litDirective$:t,values:e});let It=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
230
|
+
/**
|
231
|
+
* @license
|
232
|
+
* Copyright 2018 Google LLC
|
233
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
234
|
+
*/const jt=Nt(class extends It{constructor(t){if(super(t),t.type!==Ut||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.it)t in e||(i.remove(t),this.it.delete(t));for(const t in e){const o=!!e[t];o===this.it.has(t)||this.st?.has(t)||(o?(i.add(t),this.it.add(t)):(i.remove(t),this.it.delete(t)))}return st}}),Wt=t=>t??rt
|
235
|
+
/**
|
236
|
+
* @license
|
237
|
+
* Copyright 2020 Google LLC
|
238
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
239
|
+
*/,qt={},Kt=Nt(class extends It{constructor(t){if(super(t),t.type!==Ht&&t.type!==Ut&&t.type!==Vt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===st||e===rt)return e;const i=t.element,o=t.name;if(t.type===Ht){if(e===i[o])return st}else if(t.type===Vt){if(!!e===i.hasAttribute(o))return st}else if(t.type===Ut&&i.getAttribute(o)===e+"")return st;return((t,e=qt)=>{t._$AH=e;
|
240
|
+
/**
|
241
|
+
* @license
|
242
|
+
* Copyright 2020 Google LLC
|
243
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
244
|
+
*/})(t),e}});
|
245
|
+
/**
|
246
|
+
* @license
|
247
|
+
* Copyright 2018 Google LLC
|
248
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
249
|
+
*/var Zt=class extends Dt{constructor(){super(...arguments),this.formControlController=new zt(this,{value:t=>t.checked?t.value||"on":void 0,defaultValue:t=>t.defaultChecked,setValue:(t,e)=>t.checked=e}),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(t){"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){return ot`
|
250
|
+
<label
|
251
|
+
part="base"
|
252
|
+
class=${jt({switch:!0,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus,"switch--small":"small"===this.size,"switch--medium":"medium"===this.size,"switch--large":"large"===this.size})}
|
253
|
+
>
|
254
|
+
<input
|
255
|
+
class="switch__input"
|
256
|
+
type="checkbox"
|
257
|
+
title=${this.title}
|
258
|
+
name=${this.name}
|
259
|
+
value=${Wt(this.value)}
|
260
|
+
.checked=${Kt(this.checked)}
|
261
|
+
.disabled=${this.disabled}
|
262
|
+
.required=${this.required}
|
263
|
+
role="switch"
|
264
|
+
aria-checked=${this.checked?"true":"false"}
|
265
|
+
@click=${this.handleClick}
|
266
|
+
@input=${this.handleInput}
|
267
|
+
@invalid=${this.handleInvalid}
|
268
|
+
@blur=${this.handleBlur}
|
269
|
+
@focus=${this.handleFocus}
|
270
|
+
@keydown=${this.handleKeyDown}
|
271
|
+
/>
|
272
|
+
|
273
|
+
<span part="control" class="switch__control">
|
274
|
+
<span part="thumb" class="switch__thumb"></span>
|
275
|
+
</span>
|
276
|
+
|
277
|
+
<div part="label" class="switch__label">
|
278
|
+
<slot></slot>
|
279
|
+
</div>
|
280
|
+
</label>
|
281
|
+
`}};Zt.styles=xt,h([Ft('input[type="checkbox"]')],Zt.prototype,"input",2),h([Rt()],Zt.prototype,"hasFocus",2),h([Mt()],Zt.prototype,"title",2),h([Mt()],Zt.prototype,"name",2),h([Mt()],Zt.prototype,"value",2),h([Mt({reflect:!0})],Zt.prototype,"size",2),h([Mt({type:Boolean,reflect:!0})],Zt.prototype,"disabled",2),h([Mt({type:Boolean,reflect:!0})],Zt.prototype,"checked",2),h([((t="value")=>(e,i)=>{const o=e.constructor,s=o.prototype.attributeChangedCallback;o.prototype.attributeChangedCallback=function(e,r,n){var a;const l=o.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t)){const e=l.converter||M,o=("function"==typeof e?e:null!=(a=null==e?void 0:e.fromAttribute)?a:M.fromAttribute)(n,l.type);this[t]!==o&&(this[i]=o)}s.call(this,e,r,n)}})("checked")],Zt.prototype,"defaultChecked",2),h([Mt({reflect:!0})],Zt.prototype,"form",2),h([Mt({type:Boolean,reflect:!0})],Zt.prototype,"required",2),h([Pt("checked",{waitUntilFirstUpdate:!0})],Zt.prototype,"handleCheckedChange",1),h([Pt("disabled",{waitUntilFirstUpdate:!0})],Zt.prototype,"handleDisabledChange",1),Zt.define("sl-switch");var Gt=_`
|
282
|
+
${$t}
|
283
|
+
|
284
|
+
:host {
|
285
|
+
display: inline-block;
|
286
|
+
}
|
287
|
+
|
288
|
+
.tab {
|
289
|
+
display: inline-flex;
|
290
|
+
align-items: center;
|
291
|
+
font-family: var(--sl-font-sans);
|
292
|
+
font-size: var(--sl-font-size-small);
|
293
|
+
font-weight: var(--sl-font-weight-semibold);
|
294
|
+
border-radius: var(--sl-border-radius-medium);
|
295
|
+
color: var(--sl-color-neutral-600);
|
296
|
+
padding: var(--sl-spacing-medium) var(--sl-spacing-large);
|
297
|
+
white-space: nowrap;
|
298
|
+
user-select: none;
|
299
|
+
-webkit-user-select: none;
|
300
|
+
cursor: pointer;
|
301
|
+
transition:
|
302
|
+
var(--transition-speed) box-shadow,
|
303
|
+
var(--transition-speed) color;
|
304
|
+
}
|
305
|
+
|
306
|
+
.tab:hover:not(.tab--disabled) {
|
307
|
+
color: var(--sl-color-primary-600);
|
308
|
+
}
|
309
|
+
|
310
|
+
.tab:focus {
|
311
|
+
outline: none;
|
312
|
+
}
|
313
|
+
|
314
|
+
.tab:focus-visible:not(.tab--disabled) {
|
315
|
+
color: var(--sl-color-primary-600);
|
316
|
+
}
|
317
|
+
|
318
|
+
.tab:focus-visible {
|
319
|
+
outline: var(--sl-focus-ring);
|
320
|
+
outline-offset: calc(-1 * var(--sl-focus-ring-width) - var(--sl-focus-ring-offset));
|
321
|
+
}
|
322
|
+
|
323
|
+
.tab.tab--active:not(.tab--disabled) {
|
324
|
+
color: var(--sl-color-primary-600);
|
325
|
+
}
|
326
|
+
|
327
|
+
.tab.tab--closable {
|
328
|
+
padding-inline-end: var(--sl-spacing-small);
|
329
|
+
}
|
330
|
+
|
331
|
+
.tab.tab--disabled {
|
332
|
+
opacity: 0.5;
|
333
|
+
cursor: not-allowed;
|
334
|
+
}
|
335
|
+
|
336
|
+
.tab__close-button {
|
337
|
+
font-size: var(--sl-font-size-small);
|
338
|
+
margin-inline-start: var(--sl-spacing-small);
|
339
|
+
}
|
340
|
+
|
341
|
+
.tab__close-button::part(base) {
|
342
|
+
padding: var(--sl-spacing-3x-small);
|
343
|
+
}
|
344
|
+
|
345
|
+
@media (forced-colors: active) {
|
346
|
+
.tab.tab--active:not(.tab--disabled) {
|
347
|
+
outline: solid 1px transparent;
|
348
|
+
outline-offset: -3px;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
`,Yt=_`
|
352
|
+
${$t}
|
353
|
+
|
354
|
+
:host {
|
355
|
+
display: inline-block;
|
356
|
+
color: var(--sl-color-neutral-600);
|
357
|
+
}
|
358
|
+
|
359
|
+
.icon-button {
|
360
|
+
flex: 0 0 auto;
|
361
|
+
display: flex;
|
362
|
+
align-items: center;
|
363
|
+
background: none;
|
364
|
+
border: none;
|
365
|
+
border-radius: var(--sl-border-radius-medium);
|
366
|
+
font-size: inherit;
|
367
|
+
color: inherit;
|
368
|
+
padding: var(--sl-spacing-x-small);
|
369
|
+
cursor: pointer;
|
370
|
+
transition: var(--sl-transition-x-fast) color;
|
371
|
+
-webkit-appearance: none;
|
372
|
+
}
|
373
|
+
|
374
|
+
.icon-button:hover:not(.icon-button--disabled),
|
375
|
+
.icon-button:focus-visible:not(.icon-button--disabled) {
|
376
|
+
color: var(--sl-color-primary-600);
|
377
|
+
}
|
378
|
+
|
379
|
+
.icon-button:active:not(.icon-button--disabled) {
|
380
|
+
color: var(--sl-color-primary-700);
|
381
|
+
}
|
382
|
+
|
383
|
+
.icon-button:focus {
|
384
|
+
outline: none;
|
385
|
+
}
|
386
|
+
|
387
|
+
.icon-button--disabled {
|
388
|
+
opacity: 0.5;
|
389
|
+
cursor: not-allowed;
|
390
|
+
}
|
391
|
+
|
392
|
+
.icon-button:focus-visible {
|
393
|
+
outline: var(--sl-focus-ring);
|
394
|
+
outline-offset: var(--sl-focus-ring-offset);
|
395
|
+
}
|
396
|
+
|
397
|
+
.icon-button__icon {
|
398
|
+
pointer-events: none;
|
399
|
+
}
|
400
|
+
`,Jt=_`
|
401
|
+
${$t}
|
402
|
+
|
403
|
+
:host {
|
404
|
+
display: inline-block;
|
405
|
+
width: 1em;
|
406
|
+
height: 1em;
|
407
|
+
box-sizing: content-box !important;
|
408
|
+
}
|
409
|
+
|
410
|
+
svg {
|
411
|
+
display: block;
|
412
|
+
height: 100%;
|
413
|
+
width: 100%;
|
414
|
+
}
|
415
|
+
`,Xt="";function Qt(t){Xt=t}var te={name:"default",resolver:t=>function(t=""){if(!Xt){const t=[...document.getElementsByTagName("script")],e=t.find((t=>t.hasAttribute("data-shoelace")));if(e)Qt(e.getAttribute("data-shoelace"));else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let i="";e&&(i=e.getAttribute("src")),Qt(i.split("/").slice(0,-1).join("/"))}}return Xt.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}(`assets/icons/${t}.svg`)},ee={caret:'\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n ',check:'\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',"chevron-left":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n ',"chevron-right":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',copy:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n ',"eye-slash":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n ',eyedropper:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n ',"grip-vertical":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n ',indeterminate:'\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"person-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n ',"play-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n ',"pause-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n ',radio:'\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n ',"star-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n ',"x-lg":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n ',"x-circle-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n '},ie=[te,{name:"system",resolver:t=>t in ee?`data:image/svg+xml,${encodeURIComponent(ee[t])}`:""}],oe=[];function se(t){return ie.find((e=>e.name===t))}var re,ne=Symbol(),ae=Symbol(),le=new Map,ce=class extends Dt{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var i;let o;if(null==e?void 0:e.spriteSheet)return ot`<svg part="svg">
|
416
|
+
<use part="use" href="${t}"></use>
|
417
|
+
</svg>`;try{if(o=await fetch(t,{mode:"cors"}),!o.ok)return 410===o.status?ne:ae}catch(t){return ae}try{const t=document.createElement("div");t.innerHTML=await o.text();const e=t.firstElementChild;if("svg"!==(null==(i=null==e?void 0:e.tagName)?void 0:i.toLowerCase()))return ne;re||(re=new DOMParser);const s=re.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return s?(s.part.add("svg"),document.adoptNode(s)):ne}catch(t){return ne}}connectedCallback(){var t;super.connectedCallback(),t=this,oe.push(t)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,oe=oe.filter((e=>e!==t))}getIconSource(){const t=se(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:i}=this.getIconSource(),o=i?se(this.library):void 0;if(!e)return void(this.svg=null);let s=le.get(e);if(s||(s=this.resolveIcon(e,o),le.set(e,s)),!this.initialRender)return;const r=await s;if(r===ae&&le.delete(e),e===this.getIconSource().url)if(((t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e)(r))this.svg=r;else switch(r){case ae:case ne:this.svg=null,this.emit("sl-error");break;default:this.svg=r.cloneNode(!0),null==(t=null==o?void 0:o.mutator)||t.call(o,this.svg),this.emit("sl-load")}}render(){return this.svg}};ce.styles=Jt,h([Rt()],ce.prototype,"svg",2),h([Mt({reflect:!0})],ce.prototype,"name",2),h([Mt()],ce.prototype,"src",2),h([Mt()],ce.prototype,"label",2),h([Mt({reflect:!0})],ce.prototype,"library",2),h([Pt("label")],ce.prototype,"handleLabelChange",1),h([Pt(["name","src","library"])],ce.prototype,"setIcon",1);
|
418
|
+
/**
|
419
|
+
* @license
|
420
|
+
* Copyright 2020 Google LLC
|
421
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
422
|
+
*/
|
423
|
+
const he=Symbol.for(""),de=t=>{if(t?.r===he)return t?._$litStatic$},pe=(t,...e)=>({_$litStatic$:e.reduce(((e,i,o)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[o+1]),t[0]),r:he}),ue=new Map,fe=(t=>(e,...i)=>{const o=i.length;let s,r;const n=[],a=[];let l,c=0,h=!1;for(;c<o;){for(l=e[c];c<o&&void 0!==(r=i[c],s=de(r));)l+=s+e[++c],h=!0;c!==o&&a.push(r),n.push(l),c++}if(c===o&&n.push(e[o]),h){const t=n.join("$$lit$$");void 0===(e=ue.get(t))&&(n.raw=n,ue.set(t,e=n)),i=a}return t(e,...i)})(ot);var be=class extends Dt{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t=!!this.href,e=t?pe`a`:pe`button`;return fe`
|
424
|
+
<${e}
|
425
|
+
part="base"
|
426
|
+
class=${jt({"icon-button":!0,"icon-button--disabled":!t&&this.disabled,"icon-button--focused":this.hasFocus})}
|
427
|
+
?disabled=${Wt(t?void 0:this.disabled)}
|
428
|
+
type=${Wt(t?void 0:"button")}
|
429
|
+
href=${Wt(t?this.href:void 0)}
|
430
|
+
target=${Wt(t?this.target:void 0)}
|
431
|
+
download=${Wt(t?this.download:void 0)}
|
432
|
+
rel=${Wt(t&&this.target?"noreferrer noopener":void 0)}
|
433
|
+
role=${Wt(t?void 0:"button")}
|
434
|
+
aria-disabled=${this.disabled?"true":"false"}
|
435
|
+
aria-label="${this.label}"
|
436
|
+
tabindex=${this.disabled?"-1":"0"}
|
437
|
+
@blur=${this.handleBlur}
|
438
|
+
@focus=${this.handleFocus}
|
439
|
+
@click=${this.handleClick}
|
440
|
+
>
|
441
|
+
<sl-icon
|
442
|
+
class="icon-button__icon"
|
443
|
+
name=${Wt(this.name)}
|
444
|
+
library=${Wt(this.library)}
|
445
|
+
src=${Wt(this.src)}
|
446
|
+
aria-hidden="true"
|
447
|
+
></sl-icon>
|
448
|
+
</${e}>
|
449
|
+
`}};be.styles=Yt,be.dependencies={"sl-icon":ce},h([Ft(".icon-button")],be.prototype,"button",2),h([Rt()],be.prototype,"hasFocus",2),h([Mt()],be.prototype,"name",2),h([Mt()],be.prototype,"library",2),h([Mt()],be.prototype,"src",2),h([Mt()],be.prototype,"href",2),h([Mt()],be.prototype,"target",2),h([Mt()],be.prototype,"download",2),h([Mt()],be.prototype,"label",2),h([Mt({type:Boolean,reflect:!0})],be.prototype,"disabled",2);const ge=new Set,me=new MutationObserver(xe),ve=new Map;let ye,we=document.documentElement.dir||"ltr",_e=document.documentElement.lang||navigator.language;function $e(...t){t.map((t=>{const e=t.$code.toLowerCase();ve.has(e)?ve.set(e,Object.assign(Object.assign({},ve.get(e)),t)):ve.set(e,t),ye||(ye=t)})),xe()}function xe(){we=document.documentElement.dir||"ltr",_e=document.documentElement.lang||navigator.language,[...ge.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}me.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let ke=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){ge.add(this.host)}hostDisconnected(){ge.delete(this.host)}dir(){return`${this.host.dir||we}`.toLowerCase()}lang(){return`${this.host.lang||_e}`.toLowerCase()}getTranslationData(t){var e,i;const o=new Intl.Locale(t.replace(/_/g,"-")),s=null==o?void 0:o.language.toLowerCase(),r=null!==(i=null===(e=null==o?void 0:o.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"";return{locale:o,language:s,region:r,primary:ve.get(`${s}-${r}`),secondary:ve.get(s)}}exists(t,e){var i;const{primary:o,secondary:s}=this.getTranslationData(null!==(i=e.lang)&&void 0!==i?i:this.lang());return e=Object.assign({includeFallback:!1},e),!!(o&&o[t]||s&&s[t]||e.includeFallback&&ye&&ye[t])}term(t,...e){const{primary:i,secondary:o}=this.getTranslationData(this.lang());let s;if(i&&i[t])s=i[t];else if(o&&o[t])s=o[t];else{if(!ye||!ye[t])return console.error(`No translation found for: ${String(t)}`),String(t);s=ye[t]}return"function"==typeof s?s(...e):s}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(t,e)}};var Ae={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};$e(Ae);var Ce=Ae,Ee=class extends ke{};$e(Ce);var Se=0,ze=class extends Dt{constructor(){super(...arguments),this.localize=new Ee(this),this.attrId=++Se,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.tab.focus(t)}blur(){this.tab.blur()}render(){return this.id=this.id.length>0?this.id:this.componentId,ot`
|
450
|
+
<div
|
451
|
+
part="base"
|
452
|
+
class=${jt({tab:!0,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})}
|
453
|
+
tabindex=${this.disabled?"-1":"0"}
|
454
|
+
>
|
455
|
+
<slot></slot>
|
456
|
+
${this.closable?ot`
|
457
|
+
<sl-icon-button
|
458
|
+
part="close-button"
|
459
|
+
exportparts="base:close-button__base"
|
460
|
+
name="x-lg"
|
461
|
+
library="system"
|
462
|
+
label=${this.localize.term("close")}
|
463
|
+
class="tab__close-button"
|
464
|
+
@click=${this.handleCloseClick}
|
465
|
+
tabindex="-1"
|
466
|
+
></sl-icon-button>
|
467
|
+
`:""}
|
468
|
+
</div>
|
469
|
+
`}};ze.styles=Gt,ze.dependencies={"sl-icon-button":be},h([Ft(".tab")],ze.prototype,"tab",2),h([Mt({reflect:!0})],ze.prototype,"panel",2),h([Mt({type:Boolean,reflect:!0})],ze.prototype,"active",2),h([Mt({type:Boolean})],ze.prototype,"closable",2),h([Mt({type:Boolean,reflect:!0})],ze.prototype,"disabled",2),h([Pt("active")],ze.prototype,"handleActiveChange",1),h([Pt("disabled")],ze.prototype,"handleDisabledChange",1),ze.define("sl-tab");var Te=_`
|
470
|
+
${$t}
|
471
|
+
|
472
|
+
:host {
|
473
|
+
--indicator-color: var(--sl-color-primary-600);
|
474
|
+
--track-color: var(--sl-color-neutral-200);
|
475
|
+
--track-width: 2px;
|
476
|
+
|
477
|
+
display: block;
|
478
|
+
}
|
479
|
+
|
480
|
+
.tab-group {
|
481
|
+
display: flex;
|
482
|
+
border-radius: 0;
|
483
|
+
}
|
484
|
+
|
485
|
+
.tab-group__tabs {
|
486
|
+
display: flex;
|
487
|
+
position: relative;
|
488
|
+
}
|
489
|
+
|
490
|
+
.tab-group__indicator {
|
491
|
+
position: absolute;
|
492
|
+
transition:
|
493
|
+
var(--sl-transition-fast) translate ease,
|
494
|
+
var(--sl-transition-fast) width ease;
|
495
|
+
}
|
496
|
+
|
497
|
+
.tab-group--has-scroll-controls .tab-group__nav-container {
|
498
|
+
position: relative;
|
499
|
+
padding: 0 var(--sl-spacing-x-large);
|
500
|
+
}
|
501
|
+
|
502
|
+
.tab-group__body {
|
503
|
+
display: block;
|
504
|
+
overflow: auto;
|
505
|
+
}
|
506
|
+
|
507
|
+
.tab-group__scroll-button {
|
508
|
+
display: flex;
|
509
|
+
align-items: center;
|
510
|
+
justify-content: center;
|
511
|
+
position: absolute;
|
512
|
+
top: 0;
|
513
|
+
bottom: 0;
|
514
|
+
width: var(--sl-spacing-x-large);
|
515
|
+
}
|
516
|
+
|
517
|
+
.tab-group__scroll-button--start {
|
518
|
+
left: 0;
|
519
|
+
}
|
520
|
+
|
521
|
+
.tab-group__scroll-button--end {
|
522
|
+
right: 0;
|
523
|
+
}
|
524
|
+
|
525
|
+
.tab-group--rtl .tab-group__scroll-button--start {
|
526
|
+
left: auto;
|
527
|
+
right: 0;
|
528
|
+
}
|
529
|
+
|
530
|
+
.tab-group--rtl .tab-group__scroll-button--end {
|
531
|
+
left: 0;
|
532
|
+
right: auto;
|
533
|
+
}
|
534
|
+
|
535
|
+
/*
|
536
|
+
* Top
|
537
|
+
*/
|
538
|
+
|
539
|
+
.tab-group--top {
|
540
|
+
flex-direction: column;
|
541
|
+
}
|
542
|
+
|
543
|
+
.tab-group--top .tab-group__nav-container {
|
544
|
+
order: 1;
|
545
|
+
}
|
546
|
+
|
547
|
+
.tab-group--top .tab-group__nav {
|
548
|
+
display: flex;
|
549
|
+
overflow-x: auto;
|
550
|
+
|
551
|
+
/* Hide scrollbar in Firefox */
|
552
|
+
scrollbar-width: none;
|
553
|
+
}
|
554
|
+
|
555
|
+
/* Hide scrollbar in Chrome/Safari */
|
556
|
+
.tab-group--top .tab-group__nav::-webkit-scrollbar {
|
557
|
+
width: 0;
|
558
|
+
height: 0;
|
559
|
+
}
|
560
|
+
|
561
|
+
.tab-group--top .tab-group__tabs {
|
562
|
+
flex: 1 1 auto;
|
563
|
+
position: relative;
|
564
|
+
flex-direction: row;
|
565
|
+
border-bottom: solid var(--track-width) var(--track-color);
|
566
|
+
}
|
567
|
+
|
568
|
+
.tab-group--top .tab-group__indicator {
|
569
|
+
bottom: calc(-1 * var(--track-width));
|
570
|
+
border-bottom: solid var(--track-width) var(--indicator-color);
|
571
|
+
}
|
572
|
+
|
573
|
+
.tab-group--top .tab-group__body {
|
574
|
+
order: 2;
|
575
|
+
}
|
576
|
+
|
577
|
+
.tab-group--top ::slotted(sl-tab-panel) {
|
578
|
+
--padding: var(--sl-spacing-medium) 0;
|
579
|
+
}
|
580
|
+
|
581
|
+
/*
|
582
|
+
* Bottom
|
583
|
+
*/
|
584
|
+
|
585
|
+
.tab-group--bottom {
|
586
|
+
flex-direction: column;
|
587
|
+
}
|
588
|
+
|
589
|
+
.tab-group--bottom .tab-group__nav-container {
|
590
|
+
order: 2;
|
591
|
+
}
|
592
|
+
|
593
|
+
.tab-group--bottom .tab-group__nav {
|
594
|
+
display: flex;
|
595
|
+
overflow-x: auto;
|
596
|
+
|
597
|
+
/* Hide scrollbar in Firefox */
|
598
|
+
scrollbar-width: none;
|
599
|
+
}
|
600
|
+
|
601
|
+
/* Hide scrollbar in Chrome/Safari */
|
602
|
+
.tab-group--bottom .tab-group__nav::-webkit-scrollbar {
|
603
|
+
width: 0;
|
604
|
+
height: 0;
|
605
|
+
}
|
606
|
+
|
607
|
+
.tab-group--bottom .tab-group__tabs {
|
608
|
+
flex: 1 1 auto;
|
609
|
+
position: relative;
|
610
|
+
flex-direction: row;
|
611
|
+
border-top: solid var(--track-width) var(--track-color);
|
612
|
+
}
|
613
|
+
|
614
|
+
.tab-group--bottom .tab-group__indicator {
|
615
|
+
top: calc(-1 * var(--track-width));
|
616
|
+
border-top: solid var(--track-width) var(--indicator-color);
|
617
|
+
}
|
618
|
+
|
619
|
+
.tab-group--bottom .tab-group__body {
|
620
|
+
order: 1;
|
621
|
+
}
|
622
|
+
|
623
|
+
.tab-group--bottom ::slotted(sl-tab-panel) {
|
624
|
+
--padding: var(--sl-spacing-medium) 0;
|
625
|
+
}
|
626
|
+
|
627
|
+
/*
|
628
|
+
* Start
|
629
|
+
*/
|
630
|
+
|
631
|
+
.tab-group--start {
|
632
|
+
flex-direction: row;
|
633
|
+
}
|
634
|
+
|
635
|
+
.tab-group--start .tab-group__nav-container {
|
636
|
+
order: 1;
|
637
|
+
}
|
638
|
+
|
639
|
+
.tab-group--start .tab-group__tabs {
|
640
|
+
flex: 0 0 auto;
|
641
|
+
flex-direction: column;
|
642
|
+
border-inline-end: solid var(--track-width) var(--track-color);
|
643
|
+
}
|
644
|
+
|
645
|
+
.tab-group--start .tab-group__indicator {
|
646
|
+
right: calc(-1 * var(--track-width));
|
647
|
+
border-right: solid var(--track-width) var(--indicator-color);
|
648
|
+
}
|
649
|
+
|
650
|
+
.tab-group--start.tab-group--rtl .tab-group__indicator {
|
651
|
+
right: auto;
|
652
|
+
left: calc(-1 * var(--track-width));
|
653
|
+
}
|
654
|
+
|
655
|
+
.tab-group--start .tab-group__body {
|
656
|
+
flex: 1 1 auto;
|
657
|
+
order: 2;
|
658
|
+
}
|
659
|
+
|
660
|
+
.tab-group--start ::slotted(sl-tab-panel) {
|
661
|
+
--padding: 0 var(--sl-spacing-medium);
|
662
|
+
}
|
663
|
+
|
664
|
+
/*
|
665
|
+
* End
|
666
|
+
*/
|
667
|
+
|
668
|
+
.tab-group--end {
|
669
|
+
flex-direction: row;
|
670
|
+
}
|
671
|
+
|
672
|
+
.tab-group--end .tab-group__nav-container {
|
673
|
+
order: 2;
|
674
|
+
}
|
675
|
+
|
676
|
+
.tab-group--end .tab-group__tabs {
|
677
|
+
flex: 0 0 auto;
|
678
|
+
flex-direction: column;
|
679
|
+
border-left: solid var(--track-width) var(--track-color);
|
680
|
+
}
|
681
|
+
|
682
|
+
.tab-group--end .tab-group__indicator {
|
683
|
+
left: calc(-1 * var(--track-width));
|
684
|
+
border-inline-start: solid var(--track-width) var(--indicator-color);
|
685
|
+
}
|
686
|
+
|
687
|
+
.tab-group--end.tab-group--rtl .tab-group__indicator {
|
688
|
+
right: calc(-1 * var(--track-width));
|
689
|
+
left: auto;
|
690
|
+
}
|
691
|
+
|
692
|
+
.tab-group--end .tab-group__body {
|
693
|
+
flex: 1 1 auto;
|
694
|
+
order: 1;
|
695
|
+
}
|
696
|
+
|
697
|
+
.tab-group--end ::slotted(sl-tab-panel) {
|
698
|
+
--padding: 0 var(--sl-spacing-medium);
|
699
|
+
}
|
700
|
+
`;function Pe(t,e,i="vertical",o="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=s.top+e.scrollTop,n=s.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==i&&"both"!==i||(n<a?e.scrollTo({left:n,behavior:o}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:o})),"vertical"!==i&&"both"!==i||(r<c?e.scrollTo({top:r,behavior:o}):r+t.clientHeight>h&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:o}))}var Le=class extends Dt{constructor(){super(...arguments),this.localize=new Ee(this),this.tabs=[],this.panels=[],this.hasScrollControls=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator(),this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{var i;t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(null!=(i=this.getActiveTab())?i:this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(t={includeDisabled:!0}){return[...this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()].filter((e=>t.includeDisabled?"sl-tab"===e.tagName.toLowerCase():"sl-tab"===e.tagName.toLowerCase()&&!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sl-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target.closest("sl-tab");(null==e?void 0:e.closest("sl-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sl-tab");if((null==e?void 0:e.closest("sl-tab-group"))===this&&(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key))){const e=this.tabs.find((t=>t.matches(":focus"))),i="rtl"===this.localize.dir();if("sl-tab"===(null==e?void 0:e.tagName.toLowerCase())){let o=this.tabs.indexOf(e);"Home"===t.key?o=0:"End"===t.key?o=this.tabs.length-1:["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key?o--:(["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key)&&o++,o<0&&(o=this.tabs.length-1),o>this.tabs.length-1&&(o=0),this.tabs[o].focus({preventScroll:!0}),"auto"===this.activation&&this.setActiveTab(this.tabs[o],{scrollBehavior:"smooth"}),["top","bottom"].includes(this.placement)&&Pe(this.tabs[o],this.nav,"horizontal"),t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e=l({emitEvents:!0,scrollBehavior:"auto"},e),t!==this.activeTab&&!t.disabled){const i=this.activeTab;this.activeTab=t,this.tabs.forEach((t=>t.active=t===this.activeTab)),this.panels.forEach((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),this.syncIndicator(),["top","bottom"].includes(this.placement)&&Pe(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(i&&this.emit("sl-tab-hide",{detail:{name:i.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}repositionIndicator(){const t=this.getActiveTab();if(!t)return;const e=t.clientWidth,i=t.clientHeight,o="rtl"===this.localize.dir(),s=this.getAllTabs(),r=s.slice(0,s.indexOf(t)).reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`,this.indicator.style.height="auto",this.indicator.style.translate=o?-1*r.left+"px":`${r.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${i}px`,this.indicator.style.translate=`0 ${r.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then((()=>this.updateScrollControls()))}updateScrollControls(){this.noScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth}syncIndicator(){this.getActiveTab()?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return ot`
|
701
|
+
<div
|
702
|
+
part="base"
|
703
|
+
class=${jt({"tab-group":!0,"tab-group--top":"top"===this.placement,"tab-group--bottom":"bottom"===this.placement,"tab-group--start":"start"===this.placement,"tab-group--end":"end"===this.placement,"tab-group--rtl":"rtl"===this.localize.dir(),"tab-group--has-scroll-controls":this.hasScrollControls})}
|
704
|
+
@click=${this.handleClick}
|
705
|
+
@keydown=${this.handleKeyDown}
|
706
|
+
>
|
707
|
+
<div class="tab-group__nav-container" part="nav">
|
708
|
+
${this.hasScrollControls?ot`
|
709
|
+
<sl-icon-button
|
710
|
+
part="scroll-button scroll-button--start"
|
711
|
+
exportparts="base:scroll-button__base"
|
712
|
+
class="tab-group__scroll-button tab-group__scroll-button--start"
|
713
|
+
name=${t?"chevron-right":"chevron-left"}
|
714
|
+
library="system"
|
715
|
+
label=${this.localize.term("scrollToStart")}
|
716
|
+
@click=${this.handleScrollToStart}
|
717
|
+
></sl-icon-button>
|
718
|
+
`:""}
|
719
|
+
|
720
|
+
<div class="tab-group__nav">
|
721
|
+
<div part="tabs" class="tab-group__tabs" role="tablist">
|
722
|
+
<div part="active-tab-indicator" class="tab-group__indicator"></div>
|
723
|
+
<slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot>
|
724
|
+
</div>
|
725
|
+
</div>
|
726
|
+
|
727
|
+
${this.hasScrollControls?ot`
|
728
|
+
<sl-icon-button
|
729
|
+
part="scroll-button scroll-button--end"
|
730
|
+
exportparts="base:scroll-button__base"
|
731
|
+
class="tab-group__scroll-button tab-group__scroll-button--end"
|
732
|
+
name=${t?"chevron-left":"chevron-right"}
|
733
|
+
library="system"
|
734
|
+
label=${this.localize.term("scrollToEnd")}
|
735
|
+
@click=${this.handleScrollToEnd}
|
736
|
+
></sl-icon-button>
|
737
|
+
`:""}
|
738
|
+
</div>
|
739
|
+
|
740
|
+
<slot part="body" class="tab-group__body" @slotchange=${this.syncTabsAndPanels}></slot>
|
741
|
+
</div>
|
742
|
+
`}};Le.styles=Te,Le.dependencies={"sl-icon-button":be},h([Ft(".tab-group")],Le.prototype,"tabGroup",2),h([Ft(".tab-group__body")],Le.prototype,"body",2),h([Ft(".tab-group__nav")],Le.prototype,"nav",2),h([Ft(".tab-group__indicator")],Le.prototype,"indicator",2),h([Rt()],Le.prototype,"hasScrollControls",2),h([Mt()],Le.prototype,"placement",2),h([Mt()],Le.prototype,"activation",2),h([Mt({attribute:"no-scroll-controls",type:Boolean})],Le.prototype,"noScrollControls",2),h([Pt("noScrollControls",{waitUntilFirstUpdate:!0})],Le.prototype,"updateScrollControls",1),h([Pt("placement",{waitUntilFirstUpdate:!0})],Le.prototype,"syncIndicator",1),Le.define("sl-tab-group");var Oe=_`
|
743
|
+
${$t}
|
744
|
+
|
745
|
+
:host {
|
746
|
+
--padding: 0;
|
747
|
+
|
748
|
+
display: none;
|
749
|
+
}
|
750
|
+
|
751
|
+
:host([active]) {
|
752
|
+
display: block;
|
753
|
+
}
|
754
|
+
|
755
|
+
.tab-panel {
|
756
|
+
display: block;
|
757
|
+
padding: var(--padding);
|
758
|
+
}
|
759
|
+
`,Me=0,Re=class extends Dt{constructor(){super(...arguments),this.attrId=++Me,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return ot`
|
760
|
+
<slot
|
761
|
+
part="base"
|
762
|
+
class=${jt({"tab-panel":!0,"tab-panel--active":this.active})}
|
763
|
+
></slot>
|
764
|
+
`}};Re.styles=Oe,h([Mt({reflect:!0})],Re.prototype,"name",2),h([Mt({type:Boolean,reflect:!0})],Re.prototype,"active",2),h([Pt("active")],Re.prototype,"handleActiveChange",1),Re.define("sl-tab-panel");var Be=_`
|
765
|
+
${$t}
|
766
|
+
|
767
|
+
:host {
|
768
|
+
--max-width: 20rem;
|
769
|
+
--hide-delay: 0ms;
|
770
|
+
--show-delay: 150ms;
|
771
|
+
|
772
|
+
display: contents;
|
773
|
+
}
|
774
|
+
|
775
|
+
.tooltip {
|
776
|
+
--arrow-size: var(--sl-tooltip-arrow-size);
|
777
|
+
--arrow-color: var(--sl-tooltip-background-color);
|
778
|
+
}
|
779
|
+
|
780
|
+
.tooltip::part(popup) {
|
781
|
+
pointer-events: none;
|
782
|
+
z-index: var(--sl-z-index-tooltip);
|
783
|
+
}
|
784
|
+
|
785
|
+
.tooltip[placement^='top']::part(popup) {
|
786
|
+
transform-origin: bottom;
|
787
|
+
}
|
788
|
+
|
789
|
+
.tooltip[placement^='bottom']::part(popup) {
|
790
|
+
transform-origin: top;
|
791
|
+
}
|
792
|
+
|
793
|
+
.tooltip[placement^='left']::part(popup) {
|
794
|
+
transform-origin: right;
|
795
|
+
}
|
796
|
+
|
797
|
+
.tooltip[placement^='right']::part(popup) {
|
798
|
+
transform-origin: left;
|
799
|
+
}
|
800
|
+
|
801
|
+
.tooltip__body {
|
802
|
+
display: block;
|
803
|
+
width: max-content;
|
804
|
+
max-width: var(--max-width);
|
805
|
+
border-radius: var(--sl-tooltip-border-radius);
|
806
|
+
background-color: var(--sl-tooltip-background-color);
|
807
|
+
font-family: var(--sl-tooltip-font-family);
|
808
|
+
font-size: var(--sl-tooltip-font-size);
|
809
|
+
font-weight: var(--sl-tooltip-font-weight);
|
810
|
+
line-height: var(--sl-tooltip-line-height);
|
811
|
+
color: var(--sl-tooltip-color);
|
812
|
+
padding: var(--sl-tooltip-padding);
|
813
|
+
pointer-events: none;
|
814
|
+
user-select: none;
|
815
|
+
-webkit-user-select: none;
|
816
|
+
}
|
817
|
+
`,Fe=_`
|
818
|
+
${$t}
|
819
|
+
|
820
|
+
:host {
|
821
|
+
--arrow-color: var(--sl-color-neutral-1000);
|
822
|
+
--arrow-size: 6px;
|
823
|
+
|
824
|
+
/*
|
825
|
+
* These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant
|
826
|
+
* 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating.
|
827
|
+
*/
|
828
|
+
--arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
|
829
|
+
--arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
|
830
|
+
|
831
|
+
display: contents;
|
832
|
+
}
|
833
|
+
|
834
|
+
.popup {
|
835
|
+
position: absolute;
|
836
|
+
isolation: isolate;
|
837
|
+
max-width: var(--auto-size-available-width, none);
|
838
|
+
max-height: var(--auto-size-available-height, none);
|
839
|
+
}
|
840
|
+
|
841
|
+
.popup--fixed {
|
842
|
+
position: fixed;
|
843
|
+
}
|
844
|
+
|
845
|
+
.popup:not(.popup--active) {
|
846
|
+
display: none;
|
847
|
+
}
|
848
|
+
|
849
|
+
.popup__arrow {
|
850
|
+
position: absolute;
|
851
|
+
width: calc(var(--arrow-size-diagonal) * 2);
|
852
|
+
height: calc(var(--arrow-size-diagonal) * 2);
|
853
|
+
rotate: 45deg;
|
854
|
+
background: var(--arrow-color);
|
855
|
+
z-index: -1;
|
856
|
+
}
|
857
|
+
`;const De=Math.min,Ue=Math.max,He=Math.round,Ve=Math.floor,Ne=t=>({x:t,y:t}),Ie={left:"right",right:"left",bottom:"top",top:"bottom"},je={start:"end",end:"start"};function We(t,e,i){return Ue(t,De(e,i))}function qe(t,e){return"function"==typeof t?t(e):t}function Ke(t){return t.split("-")[0]}function Ze(t){return t.split("-")[1]}function Ge(t){return"x"===t?"y":"x"}function Ye(t){return"y"===t?"height":"width"}function Je(t){return["top","bottom"].includes(Ke(t))?"y":"x"}function Xe(t){return Ge(Je(t))}function Qe(t){return t.replace(/start|end/g,(t=>je[t]))}function ti(t){return t.replace(/left|right|bottom|top/g,(t=>Ie[t]))}function ei(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function ii(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function oi(t,e,i){let{reference:o,floating:s}=t;const r=Je(e),n=Xe(e),a=Ye(n),l=Ke(e),c="y"===r,h=o.x+o.width/2-s.width/2,d=o.y+o.height/2-s.height/2,p=o[a]/2-s[a]/2;let u;switch(l){case"top":u={x:h,y:o.y-s.height};break;case"bottom":u={x:h,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-s.width,y:d};break;default:u={x:o.x,y:o.y}}switch(Ze(e)){case"start":u[n]-=p*(i&&c?-1:1);break;case"end":u[n]+=p*(i&&c?-1:1)}return u}async function si(t,e){var i;void 0===e&&(e={});const{x:o,y:s,platform:r,rects:n,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:u=0}=qe(e,t),f=ei(u),b=a[p?"floating"===d?"reference":"floating":d],g=ii(await r.getClippingRect({element:null==(i=await(null==r.isElement?void 0:r.isElement(b)))||i?b:b.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),m="floating"===d?{...n.floating,x:o,y:s}:n.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},w=ii(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:m,offsetParent:v,strategy:l}):m);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}const ri=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,o;const{x:s,y:r,placement:n,middlewareData:a}=e,l=await async function(t,e){const{placement:i,platform:o,elements:s}=t,r=await(null==o.isRTL?void 0:o.isRTL(s.floating)),n=Ke(i),a=Ze(i),l="y"===Je(i),c=["left","top"].includes(n)?-1:1,h=r&&l?-1:1,d=qe(e,t);let{mainAxis:p,crossAxis:u,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof f&&(u="end"===a?-1*f:f),l?{x:u*h,y:p*c}:{x:p*c,y:u*h}}(e,t);return n===(null==(i=a.offset)?void 0:i.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:{...l,placement:n}}}}};function ni(t){return ci(t)?(t.nodeName||"").toLowerCase():"#document"}function ai(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function li(t){var e;return null==(e=(ci(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ci(t){return t instanceof Node||t instanceof ai(t).Node}function hi(t){return t instanceof Element||t instanceof ai(t).Element}function di(t){return t instanceof HTMLElement||t instanceof ai(t).HTMLElement}function pi(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof ai(t).ShadowRoot)}function ui(t){const{overflow:e,overflowX:i,overflowY:o,display:s}=vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+i)&&!["inline","contents"].includes(s)}function fi(t){return["table","td","th"].includes(ni(t))}function bi(t){const e=gi(),i=vi(t);return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function gi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function mi(t){return["html","body","#document"].includes(ni(t))}function vi(t){return ai(t).getComputedStyle(t)}function yi(t){return hi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function wi(t){if("html"===ni(t))return t;const e=t.assignedSlot||t.parentNode||pi(t)&&t.host||li(t);return pi(e)?e.host:e}function _i(t){const e=wi(t);return mi(e)?t.ownerDocument?t.ownerDocument.body:t.body:di(e)&&ui(e)?e:_i(e)}function $i(t,e,i){var o;void 0===e&&(e=[]),void 0===i&&(i=!0);const s=_i(t),r=s===(null==(o=t.ownerDocument)?void 0:o.body),n=ai(s);return r?e.concat(n,n.visualViewport||[],ui(s)?s:[],n.frameElement&&i?$i(n.frameElement):[]):e.concat(s,$i(s,[],i))}function xi(t){const e=vi(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=di(t),r=s?t.offsetWidth:i,n=s?t.offsetHeight:o,a=He(i)!==r||He(o)!==n;return a&&(i=r,o=n),{width:i,height:o,$:a}}function ki(t){return hi(t)?t:t.contextElement}function Ai(t){const e=ki(t);if(!di(e))return Ne(1);const i=e.getBoundingClientRect(),{width:o,height:s,$:r}=xi(e);let n=(r?He(i.width):i.width)/o,a=(r?He(i.height):i.height)/s;return n&&Number.isFinite(n)||(n=1),a&&Number.isFinite(a)||(a=1),{x:n,y:a}}const Ci=Ne(0);function Ei(t){const e=ai(t);return gi()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ci}function Si(t,e,i,o){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),r=ki(t);let n=Ne(1);e&&(o?hi(o)&&(n=Ai(o)):n=Ai(t));const a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==ai(t))&&e}(r,i,o)?Ei(r):Ne(0);let l=(s.left+a.x)/n.x,c=(s.top+a.y)/n.y,h=s.width/n.x,d=s.height/n.y;if(r){const t=ai(r),e=o&&hi(o)?ai(o):o;let i=t.frameElement;for(;i&&o&&e!==t;){const t=Ai(i),e=i.getBoundingClientRect(),o=vi(i),s=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=s,c+=r,i=ai(i).frameElement}}return ii({width:h,height:d,x:l,y:c})}function zi(t){return Si(li(t)).left+yi(t).scrollLeft}function Ti(t,e,i){let o;if("viewport"===e)o=function(t,e){const i=ai(t),o=li(t),s=i.visualViewport;let r=o.clientWidth,n=o.clientHeight,a=0,l=0;if(s){r=s.width,n=s.height;const t=gi();(!t||t&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:n,x:a,y:l}}(t,i);else if("document"===e)o=function(t){const e=li(t),i=yi(t),o=t.ownerDocument.body,s=Ue(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=Ue(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let n=-i.scrollLeft+zi(t);const a=-i.scrollTop;return"rtl"===vi(o).direction&&(n+=Ue(e.clientWidth,o.clientWidth)-s),{width:s,height:r,x:n,y:a}}(li(t));else if(hi(e))o=function(t,e){const i=Si(t,!0,"fixed"===e),o=i.top+t.clientTop,s=i.left+t.clientLeft,r=di(t)?Ai(t):Ne(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:s*r.x,y:o*r.y}}(e,i);else{const i=Ei(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return ii(o)}function Pi(t,e){const i=wi(t);return!(i===e||!hi(i)||mi(i))&&("fixed"===vi(i).position||Pi(i,e))}function Li(t,e,i){const o=di(e),s=li(e),r="fixed"===i,n=Si(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=Ne(0);if(o||!o&&!r)if(("body"!==ni(e)||ui(s))&&(a=yi(e)),o){const t=Si(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&(l.x=zi(s));return{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function Oi(t,e){return di(t)&&"fixed"!==vi(t).position?e?e(t):t.offsetParent:null}function Mi(t,e){const i=ai(t);if(!di(t))return i;let o=Oi(t,e);for(;o&&fi(o)&&"static"===vi(o).position;)o=Oi(o,e);return o&&("html"===ni(o)||"body"===ni(o)&&"static"===vi(o).position&&!bi(o))?i:o||function(t){let e=wi(t);for(;di(e)&&!mi(e);){if(bi(e))return e;e=wi(e)}return null}(t)||i}const Ri={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:i,strategy:o}=t;const s=di(i),r=li(i);if(i===r)return e;let n={scrollLeft:0,scrollTop:0},a=Ne(1);const l=Ne(0);if((s||!s&&"fixed"!==o)&&(("body"!==ni(i)||ui(r))&&(n=yi(i)),di(i))){const t=Si(i);a=Ai(i),l.x=t.x+i.clientLeft,l.y=t.y+i.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-n.scrollLeft*a.x+l.x,y:e.y*a.y-n.scrollTop*a.y+l.y}},getDocumentElement:li,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:o,strategy:s}=t;const r=[..."clippingAncestors"===i?function(t,e){const i=e.get(t);if(i)return i;let o=$i(t,[],!1).filter((t=>hi(t)&&"body"!==ni(t))),s=null;const r="fixed"===vi(t).position;let n=r?wi(t):t;for(;hi(n)&&!mi(n);){const e=vi(n),i=bi(n);i||"fixed"!==e.position||(s=null),(r?!i&&!s:!i&&"static"===e.position&&s&&["absolute","fixed"].includes(s.position)||ui(n)&&!i&&Pi(t,n))?o=o.filter((t=>t!==n)):s=e,n=wi(n)}return e.set(t,o),o}(e,this._c):[].concat(i),o],n=r[0],a=r.reduce(((t,i)=>{const o=Ti(e,i,s);return t.top=Ue(o.top,t.top),t.right=De(o.right,t.right),t.bottom=De(o.bottom,t.bottom),t.left=Ue(o.left,t.left),t}),Ti(e,n,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Mi,getElementRects:async function(t){let{reference:e,floating:i,strategy:o}=t;const s=this.getOffsetParent||Mi,r=this.getDimensions;return{reference:Li(e,await s(i),o),floating:{x:0,y:0,...await r(i)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=xi(t);return{width:e,height:i}},getScale:Ai,isElement:hi,isRTL:function(t){return"rtl"===vi(t).direction}};function Bi(t,e,i,o){void 0===o&&(o={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=ki(t),h=s||r?[...c?$i(c):[],...$i(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",i,{passive:!0}),r&&t.addEventListener("resize",i)}));const d=c&&a?function(t,e){let i,o=null;const s=li(t);function r(){clearTimeout(i),o&&o.disconnect(),o=null}return function n(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:h,width:d,height:p}=t.getBoundingClientRect();if(a||e(),!d||!p)return;const u={rootMargin:-Ve(h)+"px "+-Ve(s.clientWidth-(c+d))+"px "+-Ve(s.clientHeight-(h+p))+"px "+-Ve(c)+"px",threshold:Ue(0,De(1,l))||1};let f=!0;function b(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return n();e?n(!1,e):i=setTimeout((()=>{n(!1,1e-7)}),100)}f=!1}try{o=new IntersectionObserver(b,{...u,root:s.ownerDocument})}catch(t){o=new IntersectionObserver(b,u)}o.observe(t)}(!0),r}(c,i):null;let p,u=-1,f=null;n&&(f=new ResizeObserver((t=>{let[o]=t;o&&o.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame((()=>{f&&f.observe(e)}))),i()})),c&&!l&&f.observe(c),f.observe(e));let b=l?Si(t):null;return l&&function e(){const o=Si(t);!b||o.x===b.x&&o.y===b.y&&o.width===b.width&&o.height===b.height||i();b=o,p=requestAnimationFrame(e)}(),i(),()=>{h.forEach((t=>{s&&t.removeEventListener("scroll",i),r&&t.removeEventListener("resize",i)})),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Fi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:o,placement:s}=e,{mainAxis:r=!0,crossAxis:n=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=qe(t,e),c={x:i,y:o},h=await si(e,l),d=Je(Ke(s)),p=Ge(d);let u=c[p],f=c[d];if(r){const t="y"===p?"bottom":"right";u=We(u+h["y"===p?"top":"left"],u,u-h[t])}if(n){const t="y"===d?"bottom":"right";f=We(f+h["y"===d?"top":"left"],f,f-h[t])}const b=a.fn({...e,[p]:u,[d]:f});return{...b,data:{x:b.x-i,y:b.y-o}}}}},Di=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,o;const{placement:s,middlewareData:r,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:b=!0,...g}=qe(t,e);if(null!=(i=r.arrow)&&i.alignmentOffset)return{};const m=Ke(s),v=Ke(a)===a,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(v||!b?[ti(a)]:function(t){const e=ti(t);return[Qe(t),e,Qe(e)]}(a));p||"none"===f||w.push(...function(t,e,i,o){const s=Ze(t);let r=function(t,e,i){const o=["left","right"],s=["right","left"],r=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return i?e?s:o:e?o:s;case"left":case"right":return e?r:n;default:return[]}}(Ke(t),"start"===i,o);return s&&(r=r.map((t=>t+"-"+s)),e&&(r=r.concat(r.map(Qe)))),r}(a,b,f,y));const _=[a,...w],$=await si(e,g),x=[];let k=(null==(o=r.flip)?void 0:o.overflows)||[];if(h&&x.push($[m]),d){const t=function(t,e,i){void 0===i&&(i=!1);const o=Ze(t),s=Xe(t),r=Ye(s);let n="x"===s?o===(i?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(n=ti(n)),[n,ti(n)]}(s,n,y);x.push($[t[0]],$[t[1]])}if(k=[...k,{placement:s,overflows:x}],!x.every((t=>t<=0))){var A,C;const t=((null==(A=r.flip)?void 0:A.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let i=null==(C=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:C.placement;if(!i)switch(u){case"bestFit":{var E;const t=null==(E=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0];t&&(i=t);break}case"initialPlacement":i=a}if(s!==i)return{reset:{placement:i}}}return{}}}},Ui=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:i,rects:o,platform:s,elements:r}=e,{apply:n=(()=>{}),...a}=qe(t,e),l=await si(e,a),c=Ke(i),h=Ze(i),d="y"===Je(i),{width:p,height:u}=o.floating;let f,b;"top"===c||"bottom"===c?(f=c,b=h===(await(null==s.isRTL?void 0:s.isRTL(r.floating))?"start":"end")?"left":"right"):(b=c,f="end"===h?"top":"bottom");const g=u-l[f],m=p-l[b],v=!e.middlewareData.shift;let y=g,w=m;if(d){const t=p-l.left-l.right;w=h||v?De(m,t):t}else{const t=u-l.top-l.bottom;y=h||v?De(g,t):t}if(v&&!h){const t=Ue(l.left,0),e=Ue(l.right,0),i=Ue(l.top,0),o=Ue(l.bottom,0);d?w=p-2*(0!==t||0!==e?t+e:Ue(l.left,l.right)):y=u-2*(0!==i||0!==o?i+o:Ue(l.top,l.bottom))}await n({...e,availableWidth:w,availableHeight:y});const _=await s.getDimensions(r.floating);return p!==_.width||u!==_.height?{reset:{rects:!0}}:{}}}},Hi=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:o,placement:s,rects:r,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=qe(t,e)||{};if(null==c)return{};const d=ei(h),p={x:i,y:o},u=Xe(s),f=Ye(u),b=await n.getDimensions(c),g="y"===u,m=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[u]-p[u]-r.floating[f],_=p[u]-r.reference[u],$=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let x=$?$[y]:0;x&&await(null==n.isElement?void 0:n.isElement($))||(x=a.floating[y]||r.floating[f]);const k=w/2-_/2,A=x/2-b[f]/2-1,C=De(d[m],A),E=De(d[v],A),S=C,z=x-b[f]-E,T=x/2-b[f]/2+k,P=We(S,T,z),L=!l.arrow&&null!=Ze(s)&&T!=P&&r.reference[f]/2-(T<S?C:E)-b[f]/2<0,O=L?T<S?T-S:T-z:0;return{[u]:p[u]+O,data:{[u]:P,centerOffset:T-P-O,...L&&{alignmentOffset:O}},reset:L}}}),Vi=(t,e,i)=>{const o=new Map,s={platform:Ri,...i},r={...s.platform,_c:o};return(async(t,e,i)=>{const{placement:o="bottom",strategy:s="absolute",middleware:r=[],platform:n}=i,a=r.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:d}=oi(c,o,l),p=o,u={},f=0;for(let i=0;i<a.length;i++){const{name:r,fn:b}=a[i],{x:g,y:m,data:v,reset:y}=await b({x:h,y:d,initialPlacement:o,placement:p,strategy:s,middlewareData:u,rects:c,platform:n,elements:{reference:t,floating:e}});h=null!=g?g:h,d=null!=m?m:d,u={...u,[r]:{...u[r],...v}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await n.getElementRects({reference:t,floating:e,strategy:s}):y.rects),({x:h,y:d}=oi(c,p,l))),i=-1)}return{x:h,y:d,placement:p,strategy:s,middlewareData:u}})(t,e,{...s,platform:r})};function Ni(t){return function(t){for(let e=t;e;e=Ii(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Ii(t);e;e=Ii(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function Ii(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var ji=class extends Dt{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||function(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t}(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){this.anchorEl&&(this.cleanup=Bi(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[ri({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(Ui({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,i="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=i?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(Di({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Fi({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(Ui({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Hi({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>Ri.getOffsetParent(t,Ni):Ri.getOffsetParent;Vi(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:c(l({},Ri),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:i,placement:o})=>{const s="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=i.arrow.x,e=i.arrow.y;let o="",n="",a="",l="";if("start"===this.arrowPlacement){const i="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=s?i:"",l=s?"":i}else if("end"===this.arrowPlacement){const i="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=s?"":i,l=s?i:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:n,bottom:a,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sl-reposition")}render(){return ot`
|
858
|
+
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
859
|
+
|
860
|
+
<div
|
861
|
+
part="popup"
|
862
|
+
class=${jt({popup:!0,"popup--active":this.active,"popup--fixed":"fixed"===this.strategy,"popup--has-arrow":this.arrow})}
|
863
|
+
>
|
864
|
+
<slot></slot>
|
865
|
+
${this.arrow?ot`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
|
866
|
+
</div>
|
867
|
+
`}};function Wi(t,e){return new Promise((i=>{t.addEventListener(e,(function o(s){s.target===t&&(t.removeEventListener(e,o),i())}))}))}function qi(t,e,i){return new Promise((o=>{if((null==i?void 0:i.duration)===1/0)throw new Error("Promise-based animations must be finite.");const s=t.animate(e,c(l({},i),{duration:Zi()?0:i.duration}));s.addEventListener("cancel",o,{once:!0}),s.addEventListener("finish",o,{once:!0})}))}function Ki(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function Zi(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Gi(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{const i=requestAnimationFrame(e);t.addEventListener("cancel",(()=>i),{once:!0}),t.addEventListener("finish",(()=>i),{once:!0}),t.cancel()})))))}ji.styles=Fe,h([Ft(".popup")],ji.prototype,"popup",2),h([Ft(".popup__arrow")],ji.prototype,"arrowEl",2),h([Mt()],ji.prototype,"anchor",2),h([Mt({type:Boolean,reflect:!0})],ji.prototype,"active",2),h([Mt({reflect:!0})],ji.prototype,"placement",2),h([Mt({reflect:!0})],ji.prototype,"strategy",2),h([Mt({type:Number})],ji.prototype,"distance",2),h([Mt({type:Number})],ji.prototype,"skidding",2),h([Mt({type:Boolean})],ji.prototype,"arrow",2),h([Mt({attribute:"arrow-placement"})],ji.prototype,"arrowPlacement",2),h([Mt({attribute:"arrow-padding",type:Number})],ji.prototype,"arrowPadding",2),h([Mt({type:Boolean})],ji.prototype,"flip",2),h([Mt({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],ji.prototype,"flipFallbackPlacements",2),h([Mt({attribute:"flip-fallback-strategy"})],ji.prototype,"flipFallbackStrategy",2),h([Mt({type:Object})],ji.prototype,"flipBoundary",2),h([Mt({attribute:"flip-padding",type:Number})],ji.prototype,"flipPadding",2),h([Mt({type:Boolean})],ji.prototype,"shift",2),h([Mt({type:Object})],ji.prototype,"shiftBoundary",2),h([Mt({attribute:"shift-padding",type:Number})],ji.prototype,"shiftPadding",2),h([Mt({attribute:"auto-size"})],ji.prototype,"autoSize",2),h([Mt()],ji.prototype,"sync",2),h([Mt({type:Object})],ji.prototype,"autoSizeBoundary",2),h([Mt({attribute:"auto-size-padding",type:Number})],ji.prototype,"autoSizePadding",2);var Yi=class extends Dt{constructor(){super(),this.localize=new Ee(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleKeyDown=t=>{this.open&&!this.disabled&&"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=Ki(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=Ki(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}connectedCallback(){super.connectedCallback()}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sl-show"),await Gi(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:e}=b(this,"tooltip.show",{dir:this.localize.dir()});await qi(this.popup.popup,t,e),this.emit("sl-after-show")}else{this.emit("sl-hide"),await Gi(this.body);const{keyframes:t,options:e}=b(this,"tooltip.hide",{dir:this.localize.dir()});await qi(this.popup.popup,t,e),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,Wi(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Wi(this,"sl-after-hide")}render(){return ot`
|
868
|
+
<sl-popup
|
869
|
+
part="base"
|
870
|
+
exportparts="
|
871
|
+
popup:base__popup,
|
872
|
+
arrow:base__arrow
|
873
|
+
"
|
874
|
+
class=${jt({tooltip:!0,"tooltip--open":this.open})}
|
875
|
+
placement=${this.placement}
|
876
|
+
distance=${this.distance}
|
877
|
+
skidding=${this.skidding}
|
878
|
+
strategy=${this.hoist?"fixed":"absolute"}
|
879
|
+
flip
|
880
|
+
shift
|
881
|
+
arrow
|
882
|
+
>
|
883
|
+
${""}
|
884
|
+
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
885
|
+
|
886
|
+
${""}
|
887
|
+
<div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open?"polite":"off"}>
|
888
|
+
<slot name="content">${this.content}</slot>
|
889
|
+
</div>
|
890
|
+
</sl-popup>
|
891
|
+
`}};Yi.styles=Be,Yi.dependencies={"sl-popup":ji},h([Ft("slot:not([name])")],Yi.prototype,"defaultSlot",2),h([Ft(".tooltip__body")],Yi.prototype,"body",2),h([Ft("sl-popup")],Yi.prototype,"popup",2),h([Mt()],Yi.prototype,"content",2),h([Mt()],Yi.prototype,"placement",2),h([Mt({type:Boolean,reflect:!0})],Yi.prototype,"disabled",2),h([Mt({type:Number})],Yi.prototype,"distance",2),h([Mt({type:Boolean,reflect:!0})],Yi.prototype,"open",2),h([Mt({type:Number})],Yi.prototype,"skidding",2),h([Mt()],Yi.prototype,"trigger",2),h([Mt({type:Boolean})],Yi.prototype,"hoist",2),h([Pt("open",{waitUntilFirstUpdate:!0})],Yi.prototype,"handleOpenChange",1),h([Pt(["content","distance","hoist","placement","skidding"])],Yi.prototype,"handleOptionsChange",1),h([Pt("disabled")],Yi.prototype,"handleDisabledChange",1),f("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),f("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),Yi.define("sl-tooltip");var Ji=_`
|
892
|
+
${$t}
|
893
|
+
|
894
|
+
:host {
|
895
|
+
--height: 1rem;
|
896
|
+
--track-color: var(--sl-color-neutral-200);
|
897
|
+
--indicator-color: var(--sl-color-primary-600);
|
898
|
+
--label-color: var(--sl-color-neutral-0);
|
899
|
+
|
900
|
+
display: block;
|
901
|
+
}
|
902
|
+
|
903
|
+
.progress-bar {
|
904
|
+
position: relative;
|
905
|
+
background-color: var(--track-color);
|
906
|
+
height: var(--height);
|
907
|
+
border-radius: var(--sl-border-radius-pill);
|
908
|
+
box-shadow: inset var(--sl-shadow-small);
|
909
|
+
overflow: hidden;
|
910
|
+
}
|
911
|
+
|
912
|
+
.progress-bar__indicator {
|
913
|
+
height: 100%;
|
914
|
+
font-family: var(--sl-font-sans);
|
915
|
+
font-size: 12px;
|
916
|
+
font-weight: var(--sl-font-weight-normal);
|
917
|
+
background-color: var(--indicator-color);
|
918
|
+
color: var(--label-color);
|
919
|
+
text-align: center;
|
920
|
+
line-height: var(--height);
|
921
|
+
white-space: nowrap;
|
922
|
+
overflow: hidden;
|
923
|
+
transition:
|
924
|
+
400ms width,
|
925
|
+
400ms background-color;
|
926
|
+
user-select: none;
|
927
|
+
-webkit-user-select: none;
|
928
|
+
}
|
929
|
+
|
930
|
+
/* Indeterminate */
|
931
|
+
.progress-bar--indeterminate .progress-bar__indicator {
|
932
|
+
position: absolute;
|
933
|
+
animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);
|
934
|
+
}
|
935
|
+
|
936
|
+
.progress-bar--indeterminate.progress-bar--rtl .progress-bar__indicator {
|
937
|
+
animation-name: indeterminate-rtl;
|
938
|
+
}
|
939
|
+
|
940
|
+
@media (forced-colors: active) {
|
941
|
+
.progress-bar {
|
942
|
+
outline: solid 1px SelectedItem;
|
943
|
+
background-color: var(--sl-color-neutral-0);
|
944
|
+
}
|
945
|
+
|
946
|
+
.progress-bar__indicator {
|
947
|
+
outline: solid 1px SelectedItem;
|
948
|
+
background-color: SelectedItem;
|
949
|
+
}
|
950
|
+
}
|
951
|
+
|
952
|
+
@keyframes indeterminate {
|
953
|
+
0% {
|
954
|
+
left: -50%;
|
955
|
+
width: 50%;
|
956
|
+
}
|
957
|
+
75%,
|
958
|
+
100% {
|
959
|
+
left: 100%;
|
960
|
+
width: 50%;
|
961
|
+
}
|
962
|
+
}
|
963
|
+
|
964
|
+
@keyframes indeterminate-rtl {
|
965
|
+
0% {
|
966
|
+
right: -50%;
|
967
|
+
width: 50%;
|
968
|
+
}
|
969
|
+
75%,
|
970
|
+
100% {
|
971
|
+
right: 100%;
|
972
|
+
width: 50%;
|
973
|
+
}
|
974
|
+
}
|
975
|
+
`
|
976
|
+
/**
|
977
|
+
* @license
|
978
|
+
* Copyright 2018 Google LLC
|
979
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
980
|
+
*/;const Xi="important",Qi=" !"+Xi,to=Nt(class extends It{constructor(t){if(super(t),t.type!==Ut||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const o=t[i];return null==o?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ut)return this.ut=new Set(Object.keys(e)),this.render(e);for(const t of this.ut)null==e[t]&&(this.ut.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const o=e[t];if(null!=o){this.ut.add(t);const e="string"==typeof o&&o.endsWith(Qi);t.includes("-")||e?i.setProperty(t,e?o.slice(0,-11):o,e?Xi:""):i[t]=o}}return st}});var eo=class extends Dt{constructor(){super(...arguments),this.localize=new Ee(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return ot`
|
981
|
+
<div
|
982
|
+
part="base"
|
983
|
+
class=${jt({"progress-bar":!0,"progress-bar--indeterminate":this.indeterminate,"progress-bar--rtl":"rtl"===this.localize.dir()})}
|
984
|
+
role="progressbar"
|
985
|
+
title=${Wt(this.title)}
|
986
|
+
aria-label=${this.label.length>0?this.label:this.localize.term("progress")}
|
987
|
+
aria-valuemin="0"
|
988
|
+
aria-valuemax="100"
|
989
|
+
aria-valuenow=${this.indeterminate?0:this.value}
|
990
|
+
>
|
991
|
+
<div part="indicator" class="progress-bar__indicator" style=${to({width:`${this.value}%`})}>
|
992
|
+
${this.indeterminate?"":ot` <slot part="label" class="progress-bar__label"></slot> `}
|
993
|
+
</div>
|
994
|
+
</div>
|
995
|
+
`}};eo.styles=Ji,h([Mt({type:Number,reflect:!0})],eo.prototype,"value",2),h([Mt({type:Boolean,reflect:!0})],eo.prototype,"indeterminate",2),h([Mt()],eo.prototype,"label",2),eo.define("sl-progress-bar");export{f as setDefaultAnimation};
|