@kong-ui-public/entities-shared 3.44.2-pr.3042.b98e4535d.0 → 3.44.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/_plugin-vue_export-helper-BxQ7nON4.cjs +1 -0
  2. package/dist/{_plugin-vue_export-helper-DD7nKH1E.js → _plugin-vue_export-helper-CnFI3eWh.js} +42 -41
  3. package/dist/deck-editor.cjs.js +1 -1
  4. package/dist/deck-editor.es.js +1 -1
  5. package/dist/entities-shared.cjs.js +60 -56
  6. package/dist/entities-shared.es.js +1780 -1725
  7. package/dist/style.css +1 -1
  8. package/dist/types/components/common/DeckCodeBlock.vue.d.ts.map +1 -1
  9. package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts.map +1 -1
  10. package/dist/types/components/common/JsonCodeBlock.vue.d.ts +21 -10
  11. package/dist/types/components/common/JsonCodeBlock.vue.d.ts.map +1 -1
  12. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts +13 -2
  13. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts.map +1 -1
  14. package/dist/types/components/common/YamlCodeBlock.vue.d.ts +13 -2
  15. package/dist/types/components/common/YamlCodeBlock.vue.d.ts.map +1 -1
  16. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts +15 -0
  17. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts.map +1 -1
  18. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts +4 -4
  19. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts.map +1 -1
  20. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts +5 -5
  21. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts.map +1 -1
  22. package/dist/types/types/app-config.d.ts +1 -1
  23. package/dist/types/types/app-config.d.ts.map +1 -1
  24. package/dist/types/types/deck.d.ts +3 -1
  25. package/dist/types/types/deck.d.ts.map +1 -1
  26. package/package.json +5 -5
  27. package/dist/_plugin-vue_export-helper-BVLVXTg1.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const j=require("axios"),i=require("vue"),F=require("@kong-ui-public/i18n");var C=(e=>(e[e.InitialLoad=0]="InitialLoad",e[e.Loading=1]="Loading",e[e.Idle=2]="Idle",e[e.NoResults=3]="NoResults",e[e.NoRecords=4]="NoRecords",e[e.Error=5]="Error",e))(C||{}),R=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Partial="partial",e.CloudGatewayAddon="cloud_gateway_addon",e.BackendCluster="backend_cluster",e.VirtualCluster="virtual_cluster",e.Listener="listener",e.ProducePolicy="produce_policy",e.ConsumePolicy="consume_policy",e.ClusterPolicy="cluster_policy",e.ListenerPolicy="listener_policy",e.SchemaRegistry="schema_registry",e.StaticKey="static_key",e.TlsTrustBundle="tls_trust_bundle",e.AuthServer="auth_server",e.AuthServerScopes="auth_server_scopes",e.AuthServerClaims="auth_server_claims",e.AuthServerClients="auth_server_clients",e.Other="other",e))(R||{});const ae=Object.values(R),J=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","route","upstream","target","vault","partial"];function M(e){return J.includes(e)}const se=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],ne=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var q=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(q||{}),H=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(H||{});const oe=["structured","yaml","json","terraform","deck"];function re(){return{getAxiosInstance:(e={})=>{try{const s=i.inject("get-axios-instance",void 0);return typeof s=="function"?s(e):j.create({withCredentials:!0,timeout:3e4,...e})}catch(s){return console.warn("getAxiosInstance:",s.message||s),j.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var s;return((s=e==null?void 0:e.response)==null?void 0:s.headers["x-datadog-trace-id"])||""}}}function ie(){return{debounce:(e,s)=>{let o;return(...t)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{e(...t)},s)}}}}const E="khcp-user-table-preferences",le={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function ce(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},s=()=>{const o=e(localStorage.getItem(E));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,t)=>{try{const r=s();r.set(o,t),localStorage.setItem(E,JSON.stringify(Object.fromEntries(r.entries())))}catch(r){console.error("useTablePreferences(setTablePreferences)",r)}},getTablePreferences:(o,t)=>{const r=s();return(r==null?void 0:r.get(o))||void 0||t||le},deleteAllTablePreferences:()=>{localStorage.removeItem(E)}}}function K(e={}){const{getAxiosInstance:s}=re();return{axiosInstance:s(e)}}const ue={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},de={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},fe={actions:{viewConfiguration:"View configuration",hideConfiguration:"Hide configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform",deck:"decK"},errors:{edit:"The entity could not be edited at this time."}},pe={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ge={title:"Configuration",actions:{copy:"Copy JSON",deck_customize:"Customize before copying to CLI",deck_customize_cancel:"Cancel",sensitive_fields:"Show sensitive fields"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration",policy:"Policy Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link",partial_label:"Redis Configuration"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},me={learnMore:"Learn more",pricingTitle:"Pricing: "},he={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},be={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ye={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},_e={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ce={hint:{konnect:"The {token} environment variable must be added first. See {link} for details.",kongManager:"If your Admin API is secured, set up authentication following {link}."},documentation:"the documentation",steps:{step_1:"Step 1: Export token",step_2:"Step 2: Apply configuration"},customization:{title:"Customize before copying to CLI",copy_pat:"Make sure to copy your personal access token now. You won't be able to see it again.",reuse_pat:"Use an existing PAT if you've already generated one.",generate_pat:"Generate PAT",footer_reminder:"Changes made here won't affect your configuration."},copy_tooltip:"Copy"},ke={body:"Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",cta:"Switch to decK format"},we={title:"Generate a Personal Access Token",description:"Personal access tokens are used to authenticate decK commands and Konnect API requests.",fields:{name:{label:"Name",placeholder:"Enter token name"},expiresAt:{label:"Expiration Date",placeholder:"Select an expiration date",n_days:"{n} days"}},actions:{cancel:"Cancel",generate:"Generate",generating:"Generating…"}},Ae={global:ue,deleteModal:de,baseForm:fe,baseTable:pe,baseConfigCard:ge,emptyState:me,filter:he,debouncedFilter:ve,errors:be,validationErrors:ye,toggleModal:_e,deckCodeBlock:Ce,deckCallout:ke,generatePatModal:we};function D(){const e=F.createI18n("en-us",Ae);return{i18n:e,i18nT:F.i18nTComponent(e)}}function Q(){const e=(n,a)=>(a==null?void 0:a[n])??void 0,s=(n,a)=>{if(n.length!==a.length)return!1;const u=new Set([...n,...a]);for(const c of u){const l=n.filter(d=>d===c).length,p=a.filter(d=>d===c).length;if(l!==p)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,a,u)=>{if(u){if(Object.keys(n).length===Object.keys(a).length)for(const c in n)if(Array.isArray(n[c])&&Array.isArray(a[c])){if(s(n[c],a[c]))continue;return!1}else{if(n[c]===a[c])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(a)}catch{return!1}},sortAlpha:n=>(a,u)=>{let c=a[n]===void 0||a[n]===null?"":a[n],l=u[n]===void 0||u[n]===null?"":u[n];return Array.isArray(a[n])&&(c=a[n][0]),Array.isArray(u[n])&&(l=u[n][0]),c.localeCompare(l)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function Ie(e,s,o,t={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="1000");const{axiosInstance:r}=K(e.axiosRequestConfig),{i18n:{t:n}}=D(),{debounce:a}=ie(),u=a(async f=>{await I(f)},200),c=i.ref(!1),l=i.ref(""),p=i.ref(""),d=i.ref([]),k=i.ref([]),_=i.ref(void 0),g=i.computed(()=>{let f=`${e.apiBaseUrl}${i.unref(s)}`;return e.app==="konnect"&&(f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||"")),f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:"")}),{isValidUuid:y}=Q(),b=async()=>{try{c.value=!0;const{data:f}=await r.get(`${g.value}?size=${o}`);f!=null&&f.next||(_.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[]),k.value=t.fetchedItemsKey in f?f[t.fetchedItemsKey]:[],d.value=k.value}catch{d.value=[],l.value=n("debouncedFilter.errors.fetch")}finally{c.value=!1}},A=i.ref(""),I=async f=>{var L,P,U;if(A.value!==f){if(A.value=f??"",!f){d.value=k.value;return}if(_.value===void 0)try{if(c.value=!0,l.value="",p.value="",e.app==="konnect"){const v=`${g.value}/${f}`,{data:h}=await r.get(`${v}?size=${o}`);t.fetchedItemsKey in h?d.value=h[t.fetchedItemsKey]:h!=null&&h[t.exactMatchKey??"id"]?d.value=[h]:d.value=[]}else{const v=[];y(f)&&t.searchKeys.includes("id")?v.push((async()=>{const{data:m}=await r.get(`${g.value}/${f}`);return[m[t.fetchedItemsKey]??m]})()):v.push(...t.searchKeys.filter(m=>m!=="id").map(async m=>{const{data:w}=await r.get(`${g.value}?${m}=${f}`);return w[t.fetchedItemsKey]}));const h=await Promise.all(v),x=new Set;d.value=[],(L=h==null?void 0:h.forEach)==null||L.call(h,m=>{var w;(w=m==null?void 0:m.forEach)==null||w.call(m,O=>{x.has(O.id)||(x.add(O.id),d.value.push(O))})})}}catch(v){((P=v==null?void 0:v.response)==null?void 0:P.status)===404?p.value=n("debouncedFilter.errors.invalid"):(d.value=[],l.value=n("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",d.value=(U=_.value)==null?void 0:U.filter(v=>{var x;let h=!1;for(const m of t.searchKeys){const w=typeof v[m]=="string"?(x=v[m])==null?void 0:x.toLowerCase():v[m];w!=null&&w.includes(f.toLowerCase())&&(h=!0)}return h}),(!d.value||!d.value.length)&&(p.value=n("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:l,validationError:p,results:d,allRecords:_,loadItems:b,debouncedQueryChange:u}}const xe=Symbol("PLUGIN_FORM_LAYOUT_STATE"),N=Symbol("DECK_COMMAND_EDITOR"),$="[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).";function De(e,s){const o=i.inject(N,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckConfig))&&M(i.toValue(s))}),r=i.computed(()=>{const a=i.toValue(e),u=a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.customization:void 0;if(u&&!o){console.warn($);return}return u}),n=i.computed(()=>{const a=i.toValue(e);return a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:r,deckCalloutPreferenceKey:n}}function Oe(e,s){const o=i.inject(N,null),t=i.computed(()=>{const a=i.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckTab))&&M(i.toValue(s))}),r=i.computed(()=>{const a=i.toValue(e),u=a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.customization:void 0;if(u&&!o){console.warn($);return}return u}),n=i.computed(()=>{const a=i.toValue(e);return a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:r,deckCalloutPreferenceKey:n}}function Ee(e,s){const o=i.unref(s),t=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return t.value.search="",r=>`${t.value.href}/${r}`}function Te(){const{i18n:{t:e}}=D();return{getErrorFieldsFromError:t=>{var a,u,c;if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(((a=t==null?void 0:t.response)==null?void 0:a.status)===401)return{messages:[],fields:[]};let r=[e("errors.unexpected")];const n=[];if((u=t==null?void 0:t.response)!=null&&u.data){if((c=t.response.data.details)!=null&&c.length)return r=[],t.response.data.details.forEach(l=>{let p=e("errors.unexpected");l.messages&&Array.isArray(l.messages)&&l.messages.length&&(p=l.messages.join(", ")),l.field&&n.push({field:l.field,message:p}),r.push(`${l.field??""} ${p}`)}),{messages:r,fields:n};if(t.response.data.message&&Array.isArray(t.response.data.message))return r=[],t.response.data.message.forEach(l=>{if(l!=null&&l.constraints){const p=Object.values(l.constraints).join(", ");r.push(p),l.property&&n.push({field:l.property,message:p})}else l!=null&&l.property&&(l!=null&&l.message)?(n.push({field:l.property,message:l.message}),r.push(l.message)):r.push(l)}),{messages:r,fields:n};if(typeof t.response.data.message=="string"||typeof t.response.data=="string")return{messages:[t.response.data.message],fields:[]};if(typeof t.response.data=="object")return r=[],Object.keys(t.response.data).forEach(l=>{n.push({field:l,message:t.response.data[l]}),r.push(t.response.data[l])}),{messages:r,fields:n}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{var r,n,a,u;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((n=t==null?void 0:t.response)!=null&&n.data){if(t.response.data.detail)return t.response.data.detail;if((a=t.response.data.details)!=null&&a.length)return t.response.data.details.map(c=>{let l=e("errors.unexpected");return c.messages&&typeof c.messages=="object"&&c.messages.length&&(l=c.messages.join(", ")),c.field?`${c.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:c}=t.response.data;return Array.isArray(c)?(u=c[0])!=null&&u.constraints?Object.values(c[0].constraints)[0]:c[0]:c}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(c=>`${c} ${t.response.data[c]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Re(e){const s=window.location.origin,o=s.endsWith("/")?s:`${s}/`;try{const t=e.join("/"),r=`${o}${t}`,n=e.some(u=>u.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(r)&&!n&&new URL(r))return`${o}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function Z(e,s){const o=i.computed(()=>{const r=i.toValue(e);return r.app==="konnect"||!!r.isExactMatch}),t=i.computed(()=>{const r=i.toValue(s);return r.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r)});return r=>{const{page:n,pageSize:a,offset:u,sortColumnKey:c,sortColumnOrder:l,query:p}=r;try{let d=new URL(t.value.href);return o.value&&p?(d.search="",d=i.toValue(e).isExactMatch?new URL(`${d.href}/${p}`):new URL(`${d.href}?filter[name][contains]=${p}`)):(o.value||new URLSearchParams(p).forEach((k,_)=>{d.searchParams.append(_,k)}),c&&d.searchParams.append("sort_by",c),l==="desc"&&d.searchParams.append("sort_desc","1"),d.searchParams.append("size",String(a))),u&&n!==1&&d.searchParams.append("offset",String(u)),d.href}catch(d){return console.error("RouteList(fetcher)",d),i.toValue(s)}}}const V=new Map;function Me(e,s,o){const t=i.ref(!0),r=i.toValue(e),{axiosInstance:n}=K(r.axiosRequestConfig),a=Z(e,s),u=i.ref({status:C.Idle}),c=async d=>{var _;const k=i.toValue(o)||"data";try{u.value=t.value?{status:C.InitialLoad}:{status:C.Loading},t.value=!1;let g=a(d);g.includes("filter[name]")&&(g=`${g}&page[size]=${d.pageSize}&page[number]=${d.page}`);const y=await n.get(g);if(y.status>=400)throw y;const b=y.data,A=k&&k.replace(/[^\w-_]/gi,"");let I;b[A]?I=Array.isArray(b[A])?b[A]:[b[A]]:Array.isArray(b)?I=b:I=Object.keys(b).length?[b]:[];const f={data:I,total:I.length,...b.offset?{pagination:{offset:b.offset}}:null};return f.data.length===0&&!d.query?u.value={status:C.NoRecords,response:f}:u.value={status:C.Idle,response:f},f}catch(g){const y={data:[],total:0};return d.query&&(((_=g.response)==null?void 0:_.status)===404||g.status===404)?(u.value={status:C.NoResults,response:y,error:g.response?g:{response:g}},y):(u.value={status:C.Error,response:y,error:g.response?g:{response:g}},y)}},l=r.cacheIdentifier,p=X(l);return{fetcher:c,fetcherState:u,fetcherCacheKey:p}}function X(e){if(e){let s=V.get(e);return s||(s=i.ref(1),V.set(e,s)),s}return i.ref(1)}function Ke(){const e=(t,r="_")=>t?t.split(r).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",s=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(s,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const ee=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,S=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const s=e.match(ee);if(!s)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return s.shift(),s},B=e=>e==="*"||e==="x"||e==="X",z=e=>{const s=parseInt(e,10);return isNaN(s)?e:s},Ne=(e,s)=>typeof e!=typeof s?[String(e),String(s)]:[e,s],$e=(e,s)=>{if(B(e)||B(s))return 0;const[o,t]=Ne(z(e),z(s));return o>t?1:o<t?-1:0},G=(e,s)=>{for(let o=0;o<Math.max(e.length,s.length);o++){const t=$e(e[o]||"0",s[o]||"0");if(t!==0)return t}return 0},Le=(e,s)=>{const o=S(e),t=S(s),r=o.pop(),n=t.pop(),a=G(o,t);return a!==0?a:r&&n?G(r.split("."),n.split(".")):r||n?r?-1:1:0},W=(e,s,o)=>{Pe(o);const t=Le(e,s);return te[o].includes(t)},te={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Y=Object.keys(te),Pe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Y.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Y.join("|")}`)},Ue=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ee.test(e);function je(e){const{gatewayInfo:s,supportedRange:o}=e;if(!s)return!0;const{edition:t,version:r}=s;if(!Ue(r))return console.error("Invalid version"),!1;const n=o[t];if(!n)return!1;const[a,u]=n;return!(a&&W(r,a,"<")||u&&W(r,u,">"))}function Fe(e){const s=i.ref(0),o=i.ref(0),t=i.ref(!1);return i.watch(e,n=>{n&&!t.value&&(s.value=n.offsetWidth,o.value=n.scrollWidth,t.value=!0)}),{isTruncated:i.computed(()=>s.value<o.value)}}function Ve(){const{i18n:{t:e}}=D();return{utf8Name:o=>/^[\p{N}\p{L}.\-_~]*$/u.test(o)?"":e("validationErrors.utf8Name")}}const T=Symbol("schema"),Se=e=>{i.provide(T,e)},Be=e=>{var r,n;const s=i.inject(T,void 0),o=(n=(r=s==null?void 0:s.value)==null?void 0:r.fields)==null?void 0:n.find(a=>Object.keys(a)[0]===e),t=i.toRef(o==null?void 0:o[e]);return i.provide(T,t),t};function ze(e){let s="";const o=i.ref(!1),t=i.ref(null),r=i.computed(()=>{let a;return o.value?a=!0:t.value?a=t.value.hasData||e&&i.toValue(e):a=!1,!a});return{tableState:t,hasRecords:o,hideTableToolbar:r,handleStateChange:a=>{a.hasData?o.value=!0:a.state==="success"&&!a.hasData&&(!e||!s)&&(o.value=!1),e&&(s=i.toValue(e)),t.value={...a}}}}const Ge={useAxios:K,useDebouncedFilter:Ie,useDeleteUrlBuilder:Ee,useBaseEntityDeckOptions:De,useBaseFormDeckOptions:Oe,useErrors:Te,useExternalLinkCreator:Re,useFetcher:Me,useFetcherCacheKey:X,useFetchUrlBuilder:Z,useHelpers:Q,useStringHelpers:Ke,useI18n:D,useGatewayFeatureSupported:je,useTruncationDetector:Fe,useValidators:Ve,useSchemaProvider:Se,useSubSchema:Be,useTableState:ze},We=(e,s)=>{const o=e.__vccOpts||e;for(const[t,r]of s)o[t]=r;return o};exports.CONFIG_CARD_FORMATS=oe;exports.ConfigurationSchemaSection=H;exports.ConfigurationSchemaType=q;exports.DECK_COMMAND_EDITOR_KEY=N;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=$;exports.EventGatewayTypesArray=se;exports.FetcherStatus=C;exports.IdentityTypesArray=ne;exports.PLUGIN_FORM_LAYOUT_STATE=xe;exports.SupportedEntityDeckArray=J;exports.SupportedEntityType=R;exports.SupportedEntityTypesArray=ae;exports._export_sfc=We;exports.composables=Ge;exports.ft=ce;exports.isSupportedDeckEntityType=M;
@@ -1,5 +1,5 @@
1
1
  import N from "axios";
2
- import { inject as R, ref as m, computed as _, unref as W, toValue as h, watch as se, toRef as ne, provide as J } from "vue";
2
+ import { inject as R, ref as h, computed as _, unref as W, toValue as m, watch as se, toRef as ne, provide as J } from "vue";
3
3
  import { createI18n as re, i18nTComponent as oe } from "@kong-ui-public/i18n";
4
4
  var x = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(x || {}), Y = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.CloudGatewayAddon = "cloud_gateway_addon", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.TlsTrustBundle = "tls_trust_bundle", e.AuthServer = "auth_server", e.AuthServerScopes = "auth_server_scopes", e.AuthServerClaims = "auth_server_claims", e.AuthServerClients = "auth_server_clients", e.Other = "other", e))(Y || {});
5
5
  const Qe = Object.values(Y), ie = [
@@ -113,7 +113,7 @@ const pe = {
113
113
  }, ge = {
114
114
  message: "Are you sure you want to delete this {entityType}?",
115
115
  messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
116
- }, me = {
116
+ }, he = {
117
117
  actions: {
118
118
  viewConfiguration: "View configuration",
119
119
  hideConfiguration: "Hide configuration",
@@ -132,7 +132,7 @@ const pe = {
132
132
  errors: {
133
133
  edit: "The entity could not be edited at this time."
134
134
  }
135
- }, he = {
135
+ }, me = {
136
136
  emptyState: {
137
137
  noSearchResultsTitle: "No results found",
138
138
  noSearchResultsMessage: "Please adjust the criteria and try again.",
@@ -143,7 +143,8 @@ const pe = {
143
143
  actions: {
144
144
  copy: "Copy JSON",
145
145
  deck_customize: "Customize before copying to CLI",
146
- deck_customize_cancel: "Cancel"
146
+ deck_customize_cancel: "Cancel",
147
+ sensitive_fields: "Show sensitive fields"
147
148
  },
148
149
  sections: {
149
150
  advanced: "Advanced",
@@ -196,9 +197,9 @@ const pe = {
196
197
  }, Ce = {
197
198
  unexpected: "An unexpected error has occurred",
198
199
  dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
199
- }, ke = {
200
- utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
201
200
  }, we = {
201
+ utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
202
+ }, ke = {
202
203
  enable: {
203
204
  title: "Enable {entityType}",
204
205
  message: "Are you sure you want to enable the {entityType} {entityName}?",
@@ -252,15 +253,15 @@ const pe = {
252
253
  }, De = {
253
254
  global: pe,
254
255
  deleteModal: ge,
255
- baseForm: me,
256
- baseTable: he,
256
+ baseForm: he,
257
+ baseTable: me,
257
258
  baseConfigCard: ve,
258
259
  emptyState: be,
259
260
  filter: ye,
260
261
  debouncedFilter: _e,
261
262
  errors: Ce,
262
- validationErrors: ke,
263
- toggleModal: we,
263
+ validationErrors: we,
264
+ toggleModal: ke,
264
265
  deckCodeBlock: Ae,
265
266
  deckCallout: xe,
266
267
  generatePatModal: Ie
@@ -322,27 +323,27 @@ function Oe(e, s, r, t = {
322
323
  r || (r = "1000");
323
324
  const { axiosInstance: o } = L(e.axiosRequestConfig), { i18n: { t: n } } = K(), { debounce: a } = de(), c = a(async (d) => {
324
325
  await D(d);
325
- }, 200), l = m(!1), i = m(""), f = m(""), u = m([]), w = m([]), k = m(void 0), p = _(() => {
326
+ }, 200), l = h(!1), i = h(""), f = h(""), u = h([]), k = h([]), w = h(void 0), p = _(() => {
326
327
  let d = `${e.apiBaseUrl}${W(s)}`;
327
328
  return e.app === "konnect" && (d = d.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "")), d.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "");
328
329
  }), { isValidUuid: C } = Q(), y = async () => {
329
330
  try {
330
331
  l.value = !0;
331
332
  const { data: d } = await o.get(`${p.value}?size=${r}`);
332
- d != null && d.next || (k.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : []), w.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : [], u.value = w.value;
333
+ d != null && d.next || (w.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : []), k.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : [], u.value = k.value;
333
334
  } catch {
334
335
  u.value = [], i.value = n("debouncedFilter.errors.fetch");
335
336
  } finally {
336
337
  l.value = !1;
337
338
  }
338
- }, I = m(""), D = async (d) => {
339
+ }, I = h(""), D = async (d) => {
339
340
  var M, T, U;
340
341
  if (I.value !== d) {
341
342
  if (I.value = d ?? "", !d) {
342
- u.value = w.value;
343
+ u.value = k.value;
343
344
  return;
344
345
  }
345
- if (k.value === void 0)
346
+ if (w.value === void 0)
346
347
  try {
347
348
  if (l.value = !0, i.value = "", f.value = "", e.app === "konnect") {
348
349
  const b = `${p.value}/${d}`, { data: v } = await o.get(`${b}?size=${r}`);
@@ -372,7 +373,7 @@ function Oe(e, s, r, t = {
372
373
  l.value = !1;
373
374
  }
374
375
  else
375
- l.value = !0, f.value = "", u.value = (U = k.value) == null ? void 0 : U.filter((b) => {
376
+ l.value = !0, f.value = "", u.value = (U = w.value) == null ? void 0 : U.filter((b) => {
376
377
  var O;
377
378
  let v = !1;
378
379
  for (const g of t.searchKeys) {
@@ -388,7 +389,7 @@ function Oe(e, s, r, t = {
388
389
  error: i,
389
390
  validationError: f,
390
391
  results: u,
391
- allRecords: k,
392
+ allRecords: w,
392
393
  loadItems: y,
393
394
  debouncedQueryChange: c
394
395
  };
@@ -396,17 +397,17 @@ function Oe(e, s, r, t = {
396
397
  const tt = Symbol("PLUGIN_FORM_LAYOUT_STATE"), q = Symbol("DECK_COMMAND_EDITOR"), Z = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).";
397
398
  function Re(e, s) {
398
399
  const r = R(q, null), t = _(() => {
399
- const a = h(e);
400
- return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckConfig)) && H(h(s));
400
+ const a = m(e);
401
+ return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckConfig)) && H(m(s));
401
402
  }), o = _(() => {
402
- const a = h(e), c = a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.customization : void 0;
403
+ const a = m(e), c = a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.customization : void 0;
403
404
  if (c && !r) {
404
405
  console.warn(Z);
405
406
  return;
406
407
  }
407
408
  return c;
408
409
  }), n = _(() => {
409
- const a = h(e);
410
+ const a = m(e);
410
411
  return a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
411
412
  });
412
413
  return {
@@ -417,17 +418,17 @@ function Re(e, s) {
417
418
  }
418
419
  function Ke(e, s) {
419
420
  const r = R(q, null), t = _(() => {
420
- const a = h(e);
421
- return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && H(h(s));
421
+ const a = m(e);
422
+ return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && H(m(s));
422
423
  }), o = _(() => {
423
- const a = h(e), c = a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.customization : void 0;
424
+ const a = m(e), c = a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.customization : void 0;
424
425
  if (c && !r) {
425
426
  console.warn(Z);
426
427
  return;
427
428
  }
428
429
  return c;
429
430
  }), n = _(() => {
430
- const a = h(e);
431
+ const a = m(e);
431
432
  return a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
432
433
  });
433
434
  return {
@@ -527,31 +528,31 @@ function Pe(e) {
527
528
  }
528
529
  function X(e, s) {
529
530
  const r = _(() => {
530
- const o = h(e);
531
+ const o = m(e);
531
532
  return o.app === "konnect" || !!o.isExactMatch;
532
533
  }), t = _(() => {
533
- const o = h(s);
534
+ const o = m(s);
534
535
  return o.startsWith("/") ? new URL(`${window.location.origin}${o}`) : new URL(o);
535
536
  });
536
537
  return (o) => {
537
538
  const { page: n, pageSize: a, offset: c, sortColumnKey: l, sortColumnOrder: i, query: f } = o;
538
539
  try {
539
540
  let u = new URL(t.value.href);
540
- return r.value && f ? (u.search = "", u = h(e).isExactMatch ? new URL(`${u.href}/${f}`) : new URL(`${u.href}?filter[name][contains]=${f}`)) : (r.value || new URLSearchParams(f).forEach((w, k) => {
541
- u.searchParams.append(k, w);
541
+ return r.value && f ? (u.search = "", u = m(e).isExactMatch ? new URL(`${u.href}/${f}`) : new URL(`${u.href}?filter[name][contains]=${f}`)) : (r.value || new URLSearchParams(f).forEach((k, w) => {
542
+ u.searchParams.append(w, k);
542
543
  }), l && u.searchParams.append("sort_by", l), i === "desc" && u.searchParams.append("sort_desc", "1"), u.searchParams.append("size", String(a))), c && n !== 1 && u.searchParams.append("offset", String(c)), u.href;
543
544
  } catch (u) {
544
- return console.error("RouteList(fetcher)", u), h(s);
545
+ return console.error("RouteList(fetcher)", u), m(s);
545
546
  }
546
547
  };
547
548
  }
548
549
  const j = /* @__PURE__ */ new Map();
549
550
  function Le(e, s, r) {
550
- const t = m(!0), o = h(e), { axiosInstance: n } = L(o.axiosRequestConfig), a = X(e, s), c = m({
551
+ const t = h(!0), o = m(e), { axiosInstance: n } = L(o.axiosRequestConfig), a = X(e, s), c = h({
551
552
  status: x.Idle
552
553
  }), l = async (u) => {
553
- var k;
554
- const w = h(r) || "data";
554
+ var w;
555
+ const k = m(r) || "data";
555
556
  try {
556
557
  c.value = t.value ? { status: x.InitialLoad } : { status: x.Loading }, t.value = !1;
557
558
  let p = a(u);
@@ -559,7 +560,7 @@ function Le(e, s, r) {
559
560
  const C = await n.get(p);
560
561
  if (C.status >= 400)
561
562
  throw C;
562
- const y = C.data, I = w && w.replace(/[^\w-_]/gi, "");
563
+ const y = C.data, I = k && k.replace(/[^\w-_]/gi, "");
563
564
  let D;
564
565
  y[I] ? D = Array.isArray(y[I]) ? y[I] : [y[I]] : Array.isArray(y) ? D = y : D = Object.keys(y).length ? [y] : [];
565
566
  const d = {
@@ -583,7 +584,7 @@ function Le(e, s, r) {
583
584
  data: [],
584
585
  total: 0
585
586
  };
586
- return u.query && (((k = p.response) == null ? void 0 : k.status) === 404 || p.status === 404) ? (c.value = {
587
+ return u.query && (((w = p.response) == null ? void 0 : w.status) === 404 || p.status === 404) ? (c.value = {
587
588
  status: x.NoResults,
588
589
  response: C,
589
590
  error: p.response ? p : { response: p }
@@ -599,9 +600,9 @@ function Le(e, s, r) {
599
600
  function ee(e) {
600
601
  if (e) {
601
602
  let s = j.get(e);
602
- return s || (s = m(1), j.set(e, s)), s;
603
+ return s || (s = h(1), j.set(e, s)), s;
603
604
  }
604
- return m(1);
605
+ return h(1);
605
606
  }
606
607
  function Me() {
607
608
  const e = (t, o = "_") => t ? t.split(o).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", s = /(?:^|[\s-:'"])\w/g;
@@ -666,7 +667,7 @@ function Be(e) {
666
667
  return !(a && G(o, a, "<") || c && G(o, c, ">"));
667
668
  }
668
669
  function ze(e) {
669
- const s = m(0), r = m(0), t = m(!1);
670
+ const s = h(0), r = h(0), t = h(!1);
670
671
  return se(e, (n) => {
671
672
  n && !t.value && (s.value = n.offsetWidth, r.value = n.scrollWidth, t.value = !0);
672
673
  }), {
@@ -688,16 +689,16 @@ const P = Symbol("schema"), Ge = (e) => {
688
689
  };
689
690
  function We(e) {
690
691
  let s = "";
691
- const r = m(!1), t = m(null), o = _(() => {
692
+ const r = h(!1), t = h(null), o = _(() => {
692
693
  let a;
693
- return r.value ? a = !0 : t.value ? a = t.value.hasData || e && h(e) : a = !1, !a;
694
+ return r.value ? a = !0 : t.value ? a = t.value.hasData || e && m(e) : a = !1, !a;
694
695
  });
695
696
  return {
696
697
  tableState: t,
697
698
  hasRecords: r,
698
699
  hideTableToolbar: o,
699
700
  handleStateChange: (a) => {
700
- a.hasData ? r.value = !0 : a.state === "success" && !a.hasData && (!e || !s) && (r.value = !1), e && (s = h(e)), t.value = { ...a };
701
+ a.hasData ? r.value = !0 : a.state === "success" && !a.hasData && (!e || !s) && (r.value = !1), e && (s = m(e)), t.value = { ...a };
701
702
  }
702
703
  };
703
704
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-BVLVXTg1.cjs"),k=require("@kong-ui-public/monaco-editor"),y=require("@kong/icons"),_=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const f={class:"deck-command-editor-wrapper"},C={class:"deck-command-copy-button"},g=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),d={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function m(){await p(n.value)}async function p(l){var i,s;if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document==null?void 0:document.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,(i=document==null?void 0:document.body)==null||i.appendChild(o),o.focus(),o.select());let t;try{t=document==null?void 0:document.execCommand("copy")}catch{t=!1}finally{(s=document==null?void 0:document.body)==null||s.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createVNode(e.unref(k.MonacoEditor),{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:d,theme:"light"},null,8,["modelValue","language"]),e.createElementVNode("div",C,[e.createVNode(e.unref(_.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>m())},{default:e.withCtx(()=>[e.createVNode(e.unref(y.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),u=a._export_sfc(g,[["__scopeId","data-v-c024a8eb"]]),v={},b={class:"editor-skeleton"};function E(r,n){const c=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",b,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,d=>e.createVNode(c,{key:d})),64))])}const h=a._export_sfc(v,[["render",E],["__scopeId","data-v-ec59bbd1"]]);function x(){e.provide(a.DECK_COMMAND_EDITOR_KEY,u)}exports.DeckCommandEditor=u;exports.DeckCommandEditorLoading=h;exports.provideDeckCommandEditor=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-BxQ7nON4.cjs"),k=require("@kong-ui-public/monaco-editor"),y=require("@kong/icons"),_=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const f={class:"deck-command-editor-wrapper"},C={class:"deck-command-copy-button"},g=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),d={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function m(){await p(n.value)}async function p(l){var i,s;if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document==null?void 0:document.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,(i=document==null?void 0:document.body)==null||i.appendChild(o),o.focus(),o.select());let t;try{t=document==null?void 0:document.execCommand("copy")}catch{t=!1}finally{(s=document==null?void 0:document.body)==null||s.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createVNode(e.unref(k.MonacoEditor),{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:d,theme:"light"},null,8,["modelValue","language"]),e.createElementVNode("div",C,[e.createVNode(e.unref(_.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>m())},{default:e.withCtx(()=>[e.createVNode(e.unref(y.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),u=a._export_sfc(g,[["__scopeId","data-v-c024a8eb"]]),v={},b={class:"editor-skeleton"};function E(r,n){const c=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",b,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,d=>e.createVNode(c,{key:d})),64))])}const h=a._export_sfc(v,[["render",E],["__scopeId","data-v-ec59bbd1"]]);function x(){e.provide(a.DECK_COMMAND_EDITOR_KEY,u)}exports.DeckCommandEditor=u;exports.DeckCommandEditorLoading=h;exports.provideDeckCommandEditor=x;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as f, useModel as k, openBlock as s, createElementBlock as i, createVNode as c, unref as t, createElementVNode as C, withCtx as g, mergeModels as v, resolveComponent as b, Fragment as h, renderList as x, provide as E } from "vue";
2
- import { c as D, _ as u, D as w } from "./_plugin-vue_export-helper-DD7nKH1E.js";
2
+ import { c as D, _ as u, D as w } from "./_plugin-vue_export-helper-CnFI3eWh.js";
3
3
  import { MonacoEditor as V } from "@kong-ui-public/monaco-editor";
4
4
  import { CopyIcon as I } from "@kong/icons";
5
5
  import { KCodeBlockIconButton as M } from "@kong/kongponents";